mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-18 00:03:38 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
96
node_modules/meow/index.js
generated
vendored
Normal file
96
node_modules/meow/index.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const buildMinimistOptions = require('minimist-options');
|
||||
const minimist = require('minimist');
|
||||
const camelcaseKeys = require('camelcase-keys');
|
||||
const decamelizeKeys = require('decamelize-keys');
|
||||
const trimNewlines = require('trim-newlines');
|
||||
const redent = require('redent');
|
||||
const readPkgUp = require('read-pkg-up');
|
||||
const loudRejection = require('loud-rejection');
|
||||
const normalizePackageData = require('normalize-package-data');
|
||||
|
||||
// Prevent caching of this module so module.parent is always accurate
|
||||
delete require.cache[__filename];
|
||||
const parentDir = path.dirname(module.parent.filename);
|
||||
|
||||
module.exports = (helpMessage, opts) => {
|
||||
loudRejection();
|
||||
|
||||
if (typeof helpMessage === 'object' && !Array.isArray(helpMessage)) {
|
||||
opts = helpMessage;
|
||||
helpMessage = '';
|
||||
}
|
||||
|
||||
opts = Object.assign({
|
||||
pkg: readPkgUp.sync({
|
||||
cwd: parentDir,
|
||||
normalize: false
|
||||
}).pkg || {},
|
||||
argv: process.argv.slice(2),
|
||||
inferType: false,
|
||||
input: 'string',
|
||||
help: helpMessage,
|
||||
autoHelp: true,
|
||||
autoVersion: true
|
||||
}, opts);
|
||||
|
||||
let minimistOpts = Object.assign({
|
||||
arguments: opts.input
|
||||
}, opts.flags);
|
||||
|
||||
minimistOpts = decamelizeKeys(minimistOpts, '-', {exclude: ['stopEarly', '--']});
|
||||
|
||||
if (opts.inferType) {
|
||||
delete minimistOpts.arguments;
|
||||
}
|
||||
|
||||
minimistOpts = buildMinimistOptions(minimistOpts);
|
||||
|
||||
const pkg = opts.pkg;
|
||||
const argv = minimist(opts.argv, minimistOpts);
|
||||
let help = redent(trimNewlines((opts.help || '').replace(/\t+\n*$/, '')), 2);
|
||||
|
||||
normalizePackageData(pkg);
|
||||
|
||||
process.title = pkg.bin ? Object.keys(pkg.bin)[0] : pkg.name;
|
||||
|
||||
let description = opts.description;
|
||||
if (!description && description !== false) {
|
||||
description = pkg.description;
|
||||
}
|
||||
|
||||
help = (description ? `\n ${description}\n` : '') + (help ? `\n${help}\n` : '\n');
|
||||
|
||||
const showHelp = code => {
|
||||
console.log(help);
|
||||
process.exit(typeof code === 'number' ? code : 2);
|
||||
};
|
||||
|
||||
const showVersion = () => {
|
||||
console.log(typeof opts.version === 'string' ? opts.version : pkg.version);
|
||||
process.exit();
|
||||
};
|
||||
|
||||
if (argv.version && opts.autoVersion) {
|
||||
showVersion();
|
||||
}
|
||||
|
||||
if (argv.help && opts.autoHelp) {
|
||||
showHelp(0);
|
||||
}
|
||||
|
||||
const input = argv._;
|
||||
delete argv._;
|
||||
|
||||
const flags = camelcaseKeys(argv, {exclude: ['--', /^\w$/]});
|
||||
|
||||
return {
|
||||
input,
|
||||
flags,
|
||||
pkg,
|
||||
help,
|
||||
showHelp,
|
||||
showVersion
|
||||
};
|
||||
};
|
||||
9
node_modules/meow/license
generated
vendored
Normal file
9
node_modules/meow/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
11
node_modules/meow/node_modules/load-json-file/index.js
generated
vendored
Normal file
11
node_modules/meow/node_modules/load-json-file/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const fs = require('graceful-fs');
|
||||
const stripBom = require('strip-bom');
|
||||
const parseJson = require('parse-json');
|
||||
const pify = require('pify');
|
||||
|
||||
const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp));
|
||||
|
||||
module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp));
|
||||
module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp);
|
||||
21
node_modules/meow/node_modules/load-json-file/license
generated
vendored
Normal file
21
node_modules/meow/node_modules/load-json-file/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
43
node_modules/meow/node_modules/load-json-file/package.json
generated
vendored
Normal file
43
node_modules/meow/node_modules/load-json-file/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "load-json-file",
|
||||
"version": "4.0.0",
|
||||
"description": "Read and parse a JSON file",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/load-json-file",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"read",
|
||||
"json",
|
||||
"parse",
|
||||
"file",
|
||||
"fs",
|
||||
"graceful",
|
||||
"load"
|
||||
],
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"parse-json": "^4.0.0",
|
||||
"pify": "^3.0.0",
|
||||
"strip-bom": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
45
node_modules/meow/node_modules/load-json-file/readme.md
generated
vendored
Normal file
45
node_modules/meow/node_modules/load-json-file/readme.md
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# load-json-file [](https://travis-ci.org/sindresorhus/load-json-file)
|
||||
|
||||
> Read and parse a JSON file
|
||||
|
||||
[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save load-json-file
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const loadJsonFile = require('load-json-file');
|
||||
|
||||
loadJsonFile('foo.json').then(json => {
|
||||
console.log(json);
|
||||
//=> {foo: true}
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### loadJsonFile(filepath)
|
||||
|
||||
Returns a promise for the parsed JSON.
|
||||
|
||||
### loadJsonFile.sync(filepath)
|
||||
|
||||
Returns the parsed JSON.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
33
node_modules/meow/node_modules/parse-json/index.js
generated
vendored
Normal file
33
node_modules/meow/node_modules/parse-json/index.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
const errorEx = require('error-ex');
|
||||
const fallback = require('json-parse-better-errors');
|
||||
|
||||
const JSONError = errorEx('JSONError', {
|
||||
fileName: errorEx.append('in %s')
|
||||
});
|
||||
|
||||
module.exports = (input, reviver, filename) => {
|
||||
if (typeof reviver === 'string') {
|
||||
filename = reviver;
|
||||
reviver = null;
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
return JSON.parse(input, reviver);
|
||||
} catch (err) {
|
||||
fallback(input, reviver);
|
||||
|
||||
throw err;
|
||||
}
|
||||
} catch (err) {
|
||||
err.message = err.message.replace(/\n/g, '');
|
||||
|
||||
const jsonErr = new JSONError(err);
|
||||
if (filename) {
|
||||
jsonErr.fileName = filename;
|
||||
}
|
||||
|
||||
throw jsonErr;
|
||||
}
|
||||
};
|
||||
9
node_modules/meow/node_modules/parse-json/license
generated
vendored
Normal file
9
node_modules/meow/node_modules/parse-json/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
43
node_modules/meow/node_modules/parse-json/package.json
generated
vendored
Normal file
43
node_modules/meow/node_modules/parse-json/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "parse-json",
|
||||
"version": "4.0.0",
|
||||
"description": "Parse JSON with more helpful errors",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/parse-json",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"vendor"
|
||||
],
|
||||
"keywords": [
|
||||
"parse",
|
||||
"json",
|
||||
"graceful",
|
||||
"error",
|
||||
"message",
|
||||
"humanize",
|
||||
"friendly",
|
||||
"helpful",
|
||||
"string",
|
||||
"str"
|
||||
],
|
||||
"dependencies": {
|
||||
"error-ex": "^1.3.1",
|
||||
"json-parse-better-errors": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"nyc": "^11.2.1",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
83
node_modules/meow/node_modules/parse-json/readme.md
generated
vendored
Normal file
83
node_modules/meow/node_modules/parse-json/readme.md
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
# parse-json [](https://travis-ci.org/sindresorhus/parse-json)
|
||||
|
||||
> Parse JSON with more helpful errors
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install parse-json
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const parseJson = require('parse-json');
|
||||
const json = '{\n\t"foo": true,\n}';
|
||||
|
||||
|
||||
JSON.parse(json);
|
||||
/*
|
||||
undefined:3
|
||||
}
|
||||
^
|
||||
SyntaxError: Unexpected token }
|
||||
*/
|
||||
|
||||
|
||||
parseJson(json);
|
||||
/*
|
||||
JSONError: Trailing comma in object at 3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
|
||||
|
||||
parseJson(json, 'foo.json');
|
||||
/*
|
||||
JSONError: Trailing comma in object in foo.json:3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
|
||||
|
||||
// You can also add the filename at a later point
|
||||
try {
|
||||
parseJson(json);
|
||||
} catch (err) {
|
||||
err.fileName = 'foo.json';
|
||||
throw err;
|
||||
}
|
||||
/*
|
||||
JSONError: Trailing comma in object in foo.json:3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### parseJson(input, [reviver], [filename])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
#### reviver
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Prescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter
|
||||
) for more.
|
||||
|
||||
#### filename
|
||||
|
||||
Type: `string`
|
||||
|
||||
Filename displayed in the error message.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
42
node_modules/meow/node_modules/path-type/index.js
generated
vendored
Normal file
42
node_modules/meow/node_modules/path-type/index.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const pify = require('pify');
|
||||
|
||||
function type(fn, fn2, fp) {
|
||||
if (typeof fp !== 'string') {
|
||||
return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`));
|
||||
}
|
||||
|
||||
return pify(fs[fn])(fp)
|
||||
.then(stats => stats[fn2]())
|
||||
.catch(err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
function typeSync(fn, fn2, fp) {
|
||||
if (typeof fp !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof fp}`);
|
||||
}
|
||||
|
||||
try {
|
||||
return fs[fn](fp)[fn2]();
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
exports.file = type.bind(null, 'stat', 'isFile');
|
||||
exports.dir = type.bind(null, 'stat', 'isDirectory');
|
||||
exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink');
|
||||
exports.fileSync = typeSync.bind(null, 'statSync', 'isFile');
|
||||
exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory');
|
||||
exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink');
|
||||
9
node_modules/meow/node_modules/path-type/license
generated
vendored
Normal file
9
node_modules/meow/node_modules/path-type/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
45
node_modules/meow/node_modules/path-type/package.json
generated
vendored
Normal file
45
node_modules/meow/node_modules/path-type/package.json
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "path-type",
|
||||
"version": "3.0.0",
|
||||
"description": "Check if a path is a file, directory, or symlink",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/path-type",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"fs",
|
||||
"type",
|
||||
"is",
|
||||
"check",
|
||||
"directory",
|
||||
"dir",
|
||||
"file",
|
||||
"filepath",
|
||||
"symlink",
|
||||
"symbolic",
|
||||
"link",
|
||||
"stat",
|
||||
"stats",
|
||||
"filesystem"
|
||||
],
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
42
node_modules/meow/node_modules/path-type/readme.md
generated
vendored
Normal file
42
node_modules/meow/node_modules/path-type/readme.md
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# path-type [](https://travis-ci.org/sindresorhus/path-type)
|
||||
|
||||
> Check if a path is a file, directory, or symlink
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install path-type
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pathType = require('path-type');
|
||||
|
||||
pathType.file('package.json').then(isFile => {
|
||||
console.log(isFile);
|
||||
//=> true
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### .file(path)
|
||||
### .dir(path)
|
||||
### .symlink(path)
|
||||
|
||||
Returns a `Promise` for a `boolean` of whether the path is the checked type.
|
||||
|
||||
### .fileSync(path)
|
||||
### .dirSync(path)
|
||||
### .symlinkSync(path)
|
||||
|
||||
Returns a `boolean` of whether the path is the checked type.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
84
node_modules/meow/node_modules/pify/index.js
generated
vendored
Normal file
84
node_modules/meow/node_modules/pify/index.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
|
||||
const processFn = (fn, opts) => function () {
|
||||
const P = opts.promiseModule;
|
||||
const args = new Array(arguments.length);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
return new P((resolve, reject) => {
|
||||
if (opts.errorFirst) {
|
||||
args.push(function (err, result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
results.unshift(err);
|
||||
reject(results);
|
||||
} else {
|
||||
resolve(results);
|
||||
}
|
||||
} else if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.push(function (result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
results[i] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn.apply(this, args);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = (obj, opts) => {
|
||||
opts = Object.assign({
|
||||
exclude: [/.+(Sync|Stream)$/],
|
||||
errorFirst: true,
|
||||
promiseModule: Promise
|
||||
}, opts);
|
||||
|
||||
const filter = key => {
|
||||
const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
};
|
||||
|
||||
let ret;
|
||||
if (typeof obj === 'function') {
|
||||
ret = function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, opts).apply(this, arguments);
|
||||
};
|
||||
} else {
|
||||
ret = Object.create(Object.getPrototypeOf(obj));
|
||||
}
|
||||
|
||||
for (const key in obj) { // eslint-disable-line guard-for-in
|
||||
const x = obj[key];
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
9
node_modules/meow/node_modules/pify/license
generated
vendored
Normal file
9
node_modules/meow/node_modules/pify/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
51
node_modules/meow/node_modules/pify/package.json
generated
vendored
Normal file
51
node_modules/meow/node_modules/pify/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "pify",
|
||||
"version": "3.0.0",
|
||||
"description": "Promisify a callback-style function",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/pify",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && npm run optimization-test",
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"promises",
|
||||
"promisify",
|
||||
"all",
|
||||
"denodify",
|
||||
"denodeify",
|
||||
"callback",
|
||||
"cb",
|
||||
"node",
|
||||
"then",
|
||||
"thenify",
|
||||
"convert",
|
||||
"transform",
|
||||
"wrap",
|
||||
"wrapper",
|
||||
"bind",
|
||||
"to",
|
||||
"async",
|
||||
"await",
|
||||
"es2015",
|
||||
"bluebird"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"pinkie-promise": "^2.0.0",
|
||||
"v8-natives": "^1.0.0",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
131
node_modules/meow/node_modules/pify/readme.md
generated
vendored
Normal file
131
node_modules/meow/node_modules/pify/readme.md
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
# pify [](https://travis-ci.org/sindresorhus/pify)
|
||||
|
||||
> Promisify a callback-style function
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save pify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const pify = require('pify');
|
||||
|
||||
// Promisify a single function
|
||||
pify(fs.readFile)('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
|
||||
// Promisify all methods in a module
|
||||
pify(fs).readFile('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pify(input, [options])
|
||||
|
||||
Returns a `Promise` wrapped version of the supplied function or module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Function` `Object`
|
||||
|
||||
Callback-style function or module whose methods you want to promisify.
|
||||
|
||||
#### options
|
||||
|
||||
##### multiArgs
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error.
|
||||
|
||||
```js
|
||||
const request = require('request');
|
||||
const pify = require('pify');
|
||||
|
||||
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
||||
const [httpResponse, body] = result;
|
||||
});
|
||||
```
|
||||
|
||||
##### include
|
||||
|
||||
Type: `string[]` `RegExp[]`
|
||||
|
||||
Methods in a module to promisify. Remaining methods will be left untouched.
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `string[]` `RegExp[]`<br>
|
||||
Default: `[/.+(Sync|Stream)$/]`
|
||||
|
||||
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
||||
|
||||
##### excludeMain
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module.
|
||||
|
||||
```js
|
||||
const pify = require('pify');
|
||||
|
||||
function fn() {
|
||||
return true;
|
||||
}
|
||||
|
||||
fn.method = (data, callback) => {
|
||||
setImmediate(() => {
|
||||
callback(null, data);
|
||||
});
|
||||
};
|
||||
|
||||
// Promisify methods but not `fn()`
|
||||
const promiseFn = pify(fn, {excludeMain: true});
|
||||
|
||||
if (promiseFn()) {
|
||||
promiseFn.method('hi').then(data => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
##### errorFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc.
|
||||
|
||||
##### promiseModule
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Custom promise module to use instead of the native one.
|
||||
|
||||
Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted
|
||||
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
26
node_modules/meow/node_modules/read-pkg-up/index.js
generated
vendored
Normal file
26
node_modules/meow/node_modules/read-pkg-up/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
const findUp = require('find-up');
|
||||
const readPkg = require('read-pkg');
|
||||
|
||||
module.exports = opts => {
|
||||
return findUp('package.json', opts).then(fp => {
|
||||
if (!fp) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return readPkg(fp, opts).then(pkg => ({pkg, path: fp}));
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.sync = opts => {
|
||||
const fp = findUp.sync('package.json', opts);
|
||||
|
||||
if (!fp) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return {
|
||||
pkg: readPkg.sync(fp, opts),
|
||||
path: fp
|
||||
};
|
||||
};
|
||||
9
node_modules/meow/node_modules/read-pkg-up/license
generated
vendored
Normal file
9
node_modules/meow/node_modules/read-pkg-up/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
57
node_modules/meow/node_modules/read-pkg-up/package.json
generated
vendored
Normal file
57
node_modules/meow/node_modules/read-pkg-up/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "read-pkg-up",
|
||||
"version": "3.0.0",
|
||||
"description": "Read the closest package.json file",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/read-pkg-up",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"json",
|
||||
"read",
|
||||
"parse",
|
||||
"file",
|
||||
"fs",
|
||||
"graceful",
|
||||
"load",
|
||||
"pkg",
|
||||
"package",
|
||||
"find",
|
||||
"up",
|
||||
"find-up",
|
||||
"findup",
|
||||
"look-up",
|
||||
"look",
|
||||
"search",
|
||||
"match",
|
||||
"resolve",
|
||||
"parent",
|
||||
"parents",
|
||||
"folder",
|
||||
"directory",
|
||||
"dir",
|
||||
"walk",
|
||||
"walking",
|
||||
"path"
|
||||
],
|
||||
"dependencies": {
|
||||
"find-up": "^2.0.0",
|
||||
"read-pkg": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
80
node_modules/meow/node_modules/read-pkg-up/readme.md
generated
vendored
Normal file
80
node_modules/meow/node_modules/read-pkg-up/readme.md
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# read-pkg-up [](https://travis-ci.org/sindresorhus/read-pkg-up)
|
||||
|
||||
> Read the closest package.json file
|
||||
|
||||
|
||||
## Why
|
||||
|
||||
- [Finds the closest package.json](https://github.com/sindresorhus/find-up)
|
||||
- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
|
||||
- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom)
|
||||
- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
|
||||
- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install read-pkg-up
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const readPkgUp = require('read-pkg-up');
|
||||
|
||||
readPkgUp().then(result => {
|
||||
console.log(result);
|
||||
/*
|
||||
{
|
||||
pkg: {
|
||||
name: 'awesome-package',
|
||||
version: '1.0.0',
|
||||
…
|
||||
},
|
||||
path: '/Users/sindresorhus/dev/awesome-package/package.json'
|
||||
}
|
||||
*/
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### readPkgUp([options])
|
||||
|
||||
Returns a `Promise` for the result object.
|
||||
|
||||
### readPkgUp.sync([options])
|
||||
|
||||
Returns the result object.
|
||||
|
||||
#### options
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start looking for a package.json file.
|
||||
|
||||
##### normalize
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file
|
||||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
|
||||
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
|
||||
- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
47
node_modules/meow/node_modules/read-pkg/index.js
generated
vendored
Normal file
47
node_modules/meow/node_modules/read-pkg/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const loadJsonFile = require('load-json-file');
|
||||
const pathType = require('path-type');
|
||||
|
||||
module.exports = (fp, opts) => {
|
||||
if (typeof fp !== 'string') {
|
||||
opts = fp;
|
||||
fp = '.';
|
||||
}
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
return pathType.dir(fp)
|
||||
.then(isDir => {
|
||||
if (isDir) {
|
||||
fp = path.join(fp, 'package.json');
|
||||
}
|
||||
|
||||
return loadJsonFile(fp);
|
||||
})
|
||||
.then(x => {
|
||||
if (opts.normalize !== false) {
|
||||
require('normalize-package-data')(x);
|
||||
}
|
||||
|
||||
return x;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.sync = (fp, opts) => {
|
||||
if (typeof fp !== 'string') {
|
||||
opts = fp;
|
||||
fp = '.';
|
||||
}
|
||||
|
||||
opts = opts || {};
|
||||
fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp;
|
||||
|
||||
const x = loadJsonFile.sync(fp);
|
||||
|
||||
if (opts.normalize !== false) {
|
||||
require('normalize-package-data')(x);
|
||||
}
|
||||
|
||||
return x;
|
||||
};
|
||||
9
node_modules/meow/node_modules/read-pkg/license
generated
vendored
Normal file
9
node_modules/meow/node_modules/read-pkg/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
42
node_modules/meow/node_modules/read-pkg/package.json
generated
vendored
Normal file
42
node_modules/meow/node_modules/read-pkg/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "read-pkg",
|
||||
"version": "3.0.0",
|
||||
"description": "Read a package.json file",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/read-pkg",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"json",
|
||||
"read",
|
||||
"parse",
|
||||
"file",
|
||||
"fs",
|
||||
"graceful",
|
||||
"load",
|
||||
"pkg",
|
||||
"package",
|
||||
"normalize"
|
||||
],
|
||||
"dependencies": {
|
||||
"load-json-file": "^4.0.0",
|
||||
"normalize-package-data": "^2.3.2",
|
||||
"path-type": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
79
node_modules/meow/node_modules/read-pkg/readme.md
generated
vendored
Normal file
79
node_modules/meow/node_modules/read-pkg/readme.md
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# read-pkg [](https://travis-ci.org/sindresorhus/read-pkg)
|
||||
|
||||
> Read a package.json file
|
||||
|
||||
|
||||
## Why
|
||||
|
||||
- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
|
||||
- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom)
|
||||
- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
|
||||
- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install read-pkg
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const readPkg = require('read-pkg');
|
||||
|
||||
readPkg().then(pkg => {
|
||||
console.log(pkg);
|
||||
//=> {name: 'read-pkg', ...}
|
||||
});
|
||||
|
||||
readPkg(__dirname).then(pkg => {
|
||||
console.log(pkg);
|
||||
//=> {name: 'read-pkg', ...}
|
||||
});
|
||||
|
||||
readPkg(path.join('unicorn', 'package.json')).then(pkg => {
|
||||
console.log(pkg);
|
||||
//=> {name: 'read-pkg', ...}
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### readPkg([path], [options])
|
||||
|
||||
Returns a `Promise` for the parsed JSON.
|
||||
|
||||
### readPkg.sync([path], [options])
|
||||
|
||||
Returns the parsed JSON.
|
||||
|
||||
#### path
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Path to a `package.json` file or its directory.
|
||||
|
||||
#### options
|
||||
|
||||
##### normalize
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file
|
||||
- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file
|
||||
- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
62
node_modules/meow/package.json
generated
vendored
Normal file
62
node_modules/meow/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "meow",
|
||||
"version": "4.0.1",
|
||||
"description": "CLI app helper",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/meow",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"cli",
|
||||
"bin",
|
||||
"util",
|
||||
"utility",
|
||||
"helper",
|
||||
"argv",
|
||||
"command",
|
||||
"line",
|
||||
"meow",
|
||||
"cat",
|
||||
"kitten",
|
||||
"parser",
|
||||
"option",
|
||||
"flags",
|
||||
"input",
|
||||
"cmd",
|
||||
"console"
|
||||
],
|
||||
"dependencies": {
|
||||
"camelcase-keys": "^4.0.0",
|
||||
"decamelize-keys": "^1.0.0",
|
||||
"loud-rejection": "^1.0.0",
|
||||
"minimist": "^1.1.3",
|
||||
"minimist-options": "^3.0.1",
|
||||
"normalize-package-data": "^2.3.4",
|
||||
"read-pkg-up": "^3.0.0",
|
||||
"redent": "^2.0.0",
|
||||
"trim-newlines": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"execa": "^0.8.0",
|
||||
"indent-string": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"unicorn/no-process-exit": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
197
node_modules/meow/readme.md
generated
vendored
Normal file
197
node_modules/meow/readme.md
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
# meow [](https://travis-ci.org/sindresorhus/meow)
|
||||
|
||||
> CLI app helper
|
||||
|
||||

|
||||
|
||||
|
||||
## Features
|
||||
|
||||
- Parses arguments
|
||||
- Converts flags to [camelCase](https://github.com/sindresorhus/camelcase)
|
||||
- Outputs version when `--version`
|
||||
- Outputs description and supplied help text when `--help`
|
||||
- Makes unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail
|
||||
- Sets the process title to the binary name defined in package.json
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install meow
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ ./foo-app.js unicorns --rainbow
|
||||
```
|
||||
|
||||
```js
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const meow = require('meow');
|
||||
const foo = require('.');
|
||||
|
||||
const cli = meow(`
|
||||
Usage
|
||||
$ foo <input>
|
||||
|
||||
Options
|
||||
--rainbow, -r Include a rainbow
|
||||
|
||||
Examples
|
||||
$ foo unicorns --rainbow
|
||||
🌈 unicorns 🌈
|
||||
`, {
|
||||
flags: {
|
||||
rainbow: {
|
||||
type: 'boolean',
|
||||
alias: 'r'
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
{
|
||||
input: ['unicorns'],
|
||||
flags: {rainbow: true},
|
||||
...
|
||||
}
|
||||
*/
|
||||
|
||||
foo(cli.input[0], cli.flags);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### meow(options, [minimistOptions])
|
||||
|
||||
Returns an `Object` with:
|
||||
|
||||
- `input` *(Array)* - Non-flag arguments
|
||||
- `flags` *(Object)* - Flags converted to camelCase
|
||||
- `pkg` *(Object)* - The `package.json` object
|
||||
- `help` *(string)* - The help text used with `--help`
|
||||
- `showHelp([code=2])` *(Function)* - Show the help text and exit with `code`
|
||||
- `showVersion()` *(Function)* - Show the version text and exit
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object` `Array` `string`
|
||||
|
||||
Can either be a string/array that is the `help` or an options object.
|
||||
|
||||
##### flags
|
||||
|
||||
Type: `Object`
|
||||
|
||||
Define argument flags.
|
||||
|
||||
The key is the flag name and the value is an object with any of:
|
||||
|
||||
- `type`: Type of value. (Possible values: `string` `boolean`)
|
||||
- `alias`: Usually used to define a short flag alias.
|
||||
- `default`: Default value when the flag is not specified.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
flags: {
|
||||
unicorn: {
|
||||
type: 'string',
|
||||
alias: 'u',
|
||||
default: 'rainbow'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### description
|
||||
|
||||
Type: `string` `boolean`<br>
|
||||
Default: The package.json `"description"` property
|
||||
|
||||
Description to show above the help text.
|
||||
|
||||
Set it to `false` to disable it altogether.
|
||||
|
||||
##### help
|
||||
|
||||
Type: `string` `boolean`
|
||||
|
||||
The help text you want shown.
|
||||
|
||||
The input is reindented and starting/ending newlines are trimmed which means you can use a [template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings) without having to care about using the correct amount of indent.
|
||||
|
||||
The description will be shown above your help text automatically.
|
||||
|
||||
##### version
|
||||
|
||||
Type: `string` `boolean`<br>
|
||||
Default: The package.json `"version"` property
|
||||
|
||||
Set a custom version output.
|
||||
|
||||
##### autoHelp
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Automatically show the help text when the `--help` flag is present. Useful to set this value to `false` when a CLI manages child CLIs with their own help text.
|
||||
|
||||
##### autoVersion
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Automatically show the version text when the `--version` flag is present. Useful to set this value to `false` when a CLI manages child CLIs with their own version text.
|
||||
|
||||
##### pkg
|
||||
|
||||
Type: `Object`<br>
|
||||
Default: Closest package.json upwards
|
||||
|
||||
package.json as an `Object`.
|
||||
|
||||
*You most likely don't need this option.*
|
||||
|
||||
##### argv
|
||||
|
||||
Type: `Array`<br>
|
||||
Default: `process.argv.slice(2)`
|
||||
|
||||
Custom arguments object.
|
||||
|
||||
##### inferType
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Infer the argument type.
|
||||
|
||||
By default, the argument `5` in `$ foo 5` becomes a string. Enabling this would infer it as a number.
|
||||
|
||||
|
||||
## Promises
|
||||
|
||||
Meow will make unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI.
|
||||
|
||||
|
||||
## Tips
|
||||
|
||||
See [`chalk`](https://github.com/chalk/chalk) if you want to colorize the terminal output.
|
||||
|
||||
See [`get-stdin`](https://github.com/sindresorhus/get-stdin) if you want to accept input from stdin.
|
||||
|
||||
See [`conf`](https://github.com/sindresorhus/conf) if you need to persist some data.
|
||||
|
||||
See [`update-notifier`](https://github.com/yeoman/update-notifier) if you want update notifications.
|
||||
|
||||
[More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user