Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cleanup-package-json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cleanup-package-json - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

14

dist/cli.js

@@ -24,2 +24,6 @@ #!/usr/bin/env node

})
.options('v', {
alias: 'version',
describe: 'Prints version.'
})
.usage('Usage: cleanup-package-json [options]')

@@ -30,6 +34,13 @@ .boolean(['h', 'v'])

constructor(opt) {
this.package = {};
let packageJSONPath = path.join(__dirname, '../package.json');
this.package = JSON.parse(fs.readFileSync(packageJSONPath, 'utf8'));
let argv = opt.argv;
if (argv.help) {
this.printVersion();
console.info(opt.help());
}
else if (argv.version) {
this.printVersion();
}
else {

@@ -102,3 +113,6 @@ let configFileName = argv.config || DEFAULT_CONFIG_NAME;

}
printVersion() {
console.info(`Version ${this.package['version']} \n`);
}
}
new Cli(opt);

46

package.json
{
"name": "cleanup-package-json",
"version": "0.0.1",
"description": "Cleans package.json file.",
"main": "index.js",
"scripts": {
"build": "tsc -p .",
"prepublish": "npm run build"
},
"author": "Martynas Zilinskas <martynas@quatrodev.com>",
"license": "GPL-3.0",
"devDependencies": {
"@types/node": "^6.0.31",
"@types/optimist": "0.0.28",
"typescript": "^2.0.0",
"typings": "^1.3.1"
},
"dependencies": {
"optimist": "^0.6.1"
},
"bin": {
"cleanup-package-json": "./dist/cli.js"
}
}
"name": "cleanup-package-json",
"version": "0.1.0",
"description": "Cleans package.json file.",
"main": "index.js",
"scripts": {
"build": "tsc -p .",
"prepublish": "npm run build"
},
"author": "Martynas Zilinskas <martynas@quatrodev.com>",
"license": "GPL-3.0",
"devDependencies": {
"@types/node": "^6.0.31",
"@types/optimist": "0.0.28",
"typescript": "^2.0.0",
"typings": "^1.3.1"
},
"dependencies": {
"optimist": "^0.6.1"
},
"bin": {
"cpj": "./dist/cli.js"
}
}

@@ -6,3 +6,3 @@ cleanup-package-json

```sh
$ npm install cleanup-package-json -g
$ npm install cpj -g
```

@@ -15,3 +15,3 @@

```sh
$ scss-bundle -h
$ cpj -h
```

@@ -25,8 +25,8 @@

```sh
$ cleanup-package-json
$ cpj
```
_With custom name config:_
_With custom file config:_
```sh
$ cleanup-package-json -c custom-config.json
$ cpj -c custom-config.json
```

@@ -33,0 +33,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc