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

minimist-subcommand

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimist-subcommand - npm Package Compare versions

Comparing version 2.0.0 to 3.0.2

dist/index.d.ts

10

examples/basic.js
#!/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,

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