@du012/npm-learning
Advanced tools
+8
-1
| #!/usr/bin/env node | ||
| const commander = require('commander'); | ||
| commander | ||
| .usage('[123123123123]') | ||
| .version('1.0.0', '-v, --version') | ||
| .option('-o, --liveReloadIsOff', 'set the livereload off') | ||
| .command('hi', 'run hi file') | ||
| .parse(process.argv) | ||
| .parse(process.argv) | ||
| console.log(commander.liveReloadIsOff) | ||
| console.log(commander.opts()) |
+5
-2
| { | ||
| "name": "@du012/npm-learning", | ||
| "version": "6.0.1", | ||
| "version": "6.0.2", | ||
| "bin": { | ||
| "hello": "./bin/hello.js" | ||
| "hi": "./bin/hello.js" | ||
| }, | ||
@@ -17,3 +17,6 @@ "description": "this is my first package module", | ||
| "commander": "^6.2.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "17.0.2" | ||
| } | ||
| } |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
909
30.6%13
62.5%0
-100%1
Infinity%