Skip to contentpackage
command-line-tool
v0.5.2command-line-tool
node >=0.10.06 depscjsopen source
- license
- MIT
- deps
- 6
- unpacked
- Unknown
- files
- Unknown
- node
- >=0.10.0
$npm install command-line-tool@0.5.2 README
GitHub-flavored package documentation.
downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
install size
Estimated unpacked size across 12 packages.
424.4 kB
Includes dependencies.
dependencies
5 direct · 5 outdated
versions
Latest published Jan 18, 2018
Aug 7, 2016
maintainers
Registry package owners.
Some conventional operations used in command-line tools.
const tool = require('command-line-tool')
Print the supplied messages then stop the process (no exit code).
| Param | Type | Description |
|---|
| [message] | string | Array.<string> | One or more messages to be written to stderr before exiting. May contain ansi.format markup. |
Prints one or more strings in red to stderr.
| Param | Type | Description |
|---|
| message | string | Array.<string> | input message(s) |
Prints one or more strings to stdout. Catches unwanted EPIPE error.
| Param | Type | Description |
|---|
| message | string | Array.<string> | input message(s) |
Stop the process with an error message.
| Param | Type | Description |
|---|
| [err] | Error | the error instance |
| [options] | object | |
| [options.exitCode] | number | defaults to 1 |
| [options.stack] | boolean | defaults to false |
Parse the command-line options.
| Param | Type | Description |
|---|
| definitions | Array.<OptionDefinitions> | to be passed to command-line-args |
| [usageSections] | Array.<section> | to be passed to command-line-usage |
| [argv] | Array.<string> | If supplied, this argv array is parsed instead of process.argv. |