minimist-subcommand
Advanced tools
Comparing version 2.0.0 to 3.0.2
#!/usr/bin/env node | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('../index'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('../dist/index'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
commands: { | ||
@@ -13,8 +13,8 @@ foo: null, | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
console.log('sub-command:', parsedCommandsAndArgv.commands); | ||
console.log('parsed options by minimist:', options); |
#!/usr/bin/env node | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('../index'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('../dist/index'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
commands: { | ||
@@ -21,8 +21,8 @@ singleton: null, | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
console.log('commands:', parsedCommandsAndArgv.commands); | ||
console.log('parsed options by minimist:', options); |
#!/usr/bin/env node | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('../index'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('../dist/index'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
default: 'bar', | ||
@@ -14,8 +14,8 @@ commands: { | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
console.log('sub-command:', parsedCommandsAndArgv.commands); | ||
console.log('parsed options by minimist:', options); |
{ | ||
"name": "minimist-subcommand", | ||
"version": "2.0.0", | ||
"version": "3.0.2", | ||
"description": "A simple sub-command parser for minimist", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"test": "mocha" | ||
"build": "$(npm bin)/tsc --project ./tsconfigs/build.json", | ||
"build-and-publish": "rm -r ./dist && npm run build && npm publish", | ||
"test": "$(npm bin)/mocha --require './setup/ts-node-reigister-for-test.js' './test/**/*.ts'" | ||
}, | ||
@@ -31,5 +34,11 @@ "repository": { | ||
"devDependencies": { | ||
"@types/minimist": "^1.2.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.18", | ||
"@types/tv4": "^1.2.29", | ||
"minimist": "1.2.0", | ||
"mocha": "2.3.3", | ||
"tv4": "^1.3.0" | ||
"mocha": "^5.0.5", | ||
"ts-node": "^7.0.1", | ||
"tv4": "^1.3.0", | ||
"typescript": "^3.2.2" | ||
}, | ||
@@ -39,2 +48,3 @@ "files": [ | ||
"README.md", | ||
"dist", | ||
"examples", | ||
@@ -41,0 +51,0 @@ "index.js", |
@@ -11,5 +11,5 @@ # minimist-subcommand | ||
```bash | ||
npm install minimist-subcommand | ||
``` | ||
npm install --save minimist-subcommand | ||
``` | ||
@@ -24,7 +24,7 @@ | ||
```js | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('minimist-subcommand'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('minimist-subcommand'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
commands: { | ||
@@ -35,6 +35,6 @@ foo: null, | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
@@ -68,7 +68,7 @@ console.log('sub-command:', parsedCommandsAndArgv.commands); | ||
```js | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('minimist-subcommand'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('minimist-subcommand'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
commands: { | ||
@@ -87,6 +87,6 @@ singleton: null, | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
@@ -114,7 +114,7 @@ console.log('commands:', parsedCommandsAndArgv.commands); | ||
```js | ||
var parseArgs = require('minimist'); | ||
var parseCommands = require('minimist-subcommand'); | ||
const parseArgs = require('minimist'); | ||
const {parseCommands} = require('minimist-subcommand'); | ||
// parse sub-commands | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
default: 'bar', | ||
@@ -126,6 +126,6 @@ commands: { | ||
}; | ||
var parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
const parsedCommandsAndArgv = parseCommands(commandDefinition, process.argv.slice(2)); | ||
// pass parsed argv to minimist | ||
var options = parseArgs(parsedCommandsAndArgv.argv); | ||
const options = parseArgs(parsedCommandsAndArgv.argv); | ||
@@ -148,5 +148,5 @@ console.log('sub-command:', parsedCommandsAndArgv.commands); | ||
```js | ||
var COMMAND_JSON_SCHEMA = require('minimist-subcommand').COMMAND_JSON_SCHEMA; | ||
const COMMAND_JSON_SCHEMA = require('minimist-subcommand').COMMAND_JSON_SCHEMA; | ||
var commandDefinition = { | ||
const commandDefinition = { | ||
commands: { | ||
@@ -153,0 +153,0 @@ foo: null, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14001
9
290
9
1