diff --git a/.editorconfig b/.editorconfig index 98a761d..1c6314a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{package.json,*.yml}] +[*.yml] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 176a458..391f0a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ * text=auto +*.js text eol=lf diff --git a/.gitignore b/.gitignore index 3c3629e..239ecff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +yarn.lock diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.travis.yml b/.travis.yml index b18bae5..7d69d74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -sudo: false language: node_js node_js: + - '8' - '6' - '4' diff --git a/index.js b/index.js index d7b4f88..691dfe6 100644 --- a/index.js +++ b/index.js @@ -62,13 +62,11 @@ module.exports = (helpMessage, opts) => { const showHelp = code => { console.log(help); - // eslint-disable-next-line unicorn/no-process-exit process.exit(typeof code === 'number' ? code : 2); }; if (argv.version && opts.version !== false) { console.log(typeof opts.version === 'string' ? opts.version : pkg.version); - // eslint-disable-next-line unicorn/no-process-exit process.exit(); } diff --git a/license b/license index 654d0bf..e7af2f7 100644 --- a/license +++ b/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (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: +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 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. +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. diff --git a/package.json b/package.json index 40a0e8f..e009be0 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,62 @@ { - "name": "meow", - "version": "3.6.0", - "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": "^2.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - }, - "devDependencies": { - "ava": "*", - "execa": "^0.6.3", - "indent-string": "^3.0.0", - "xo": "*" - }, - "xo": { - "esnext": true, - "rules": { - "xo/no-process-exit": "off" - } - } + "name": "meow", + "version": "3.6.0", + "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": "^2.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" + } + } } diff --git a/readme.md b/readme.md index 73d5397..e8dcbb2 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@ ## Features -- Parses arguments using [minimist](https://github.com/substack/minimist) +- Parses arguments - Converts flags to [camelCase](https://github.com/sindresorhus/camelcase) - Outputs version when `--version` - Outputs description and supplied help text when `--help` @@ -18,7 +18,7 @@ ## Install ``` -$ npm install --save meow +$ npm install meow ``` @@ -153,7 +153,7 @@ See [`conf`](https://github.com/sindresorhus/conf) if you need to persist some d 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) +[More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities) ## License diff --git a/test.js b/test.js index d146226..0c3aa05 100644 --- a/test.js +++ b/test.js @@ -2,7 +2,7 @@ import test from 'ava'; import indentString from 'indent-string'; import execa from 'execa'; import pkg from './package'; -import m from './'; +import m from '.'; test('return object', t => { const cli = m({