add minimist

This commit is contained in:
Joao Moreno 2016-04-22 11:23:47 +02:00
parent 9e6c1612c4
commit ee1e5a79e9
4 changed files with 43 additions and 3 deletions

7
npm-shrinkwrap.json generated
View file

@ -1,6 +1,6 @@
{
"name": "Code",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"agent-base": {
"version": "1.0.2",
@ -278,6 +278,11 @@
"from": "minimatch@>=0.2.12 <0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz"
},
"minimist": {
"version": "1.2.0",
"from": "minimist@latest",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz"
},
"ms": {
"version": "0.7.1",
"from": "ms@0.7.1",

View file

@ -25,6 +25,7 @@
"http-proxy-agent": "0.2.7",
"https-proxy-agent": "0.3.6",
"iconv-lite": "0.4.13",
"minimist": "^1.2.0",
"native-keymap": "0.1.2",
"sax": "1.1.2",
"semver": "4.3.6",

View file

@ -6,5 +6,4 @@
"repositoryURL": "https://github.com/DefinitelyTyped/DefinitelyTyped",
"license": "MIT",
"isDev": true
}
]
}]

35
src/typings/minimist.d.ts vendored Normal file
View file

@ -0,0 +1,35 @@
// Type definitions for minimist 1.1.3
// Project: https://github.com/substack/minimist
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Necroskillz <https://github.com/Necroskillz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'minimist' {
function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs;
namespace minimist {
export interface Opts {
// a string or array of strings argument names to always treat as strings
string?: string|string[];
// a string or array of strings to always treat as booleans
boolean?: boolean|string|string[];
// an object mapping string names to strings or arrays of string argument names to use
alias?: {[key:string]: string|string[]};
// an object mapping string argument names to default values
default?: {[key:string]: any};
// when true, populate argv._ with everything after the first non-option
stopEarly?: boolean;
// a function which is invoked with a command line parameter not defined in the opts configuration object.
// If the function returns false, the unknown option is not added to argv
unknown?: (arg: string) => boolean;
// when true, populate argv._ with everything before the -- and argv['--'] with everything after the --
'--'?: boolean;
}
export interface ParsedArgs {
[arg: string]: any;
_: string[];
}
}
export = minimist;
}