Package Exports
- toolsmith
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (toolsmith) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Toolsmith
Yet another CLI tool framework.
Installation
npm install toolsmithBasic Example
#!/usr/bin/env node
require('toolsmith')()
.summary('An example command.')
.option({
long: 'foo',
desc: 'Enable foo.'
})
.parameter({
name: 'bar',
desc: 'Specify one or more values for bar.',
variadic: true
})
.handler((ctx) => {
if (ctx.opts.foo) {
console.log('foo is enabled')
}
console.log('bar is ' + ctx.args.bar.join(', '))
})
.parse()$ ./example.js --help
Usage: example.js [OPTIONS...] <bar...>
Summary:
An example command.
Parameters:
bar Specify one or more values for bar.
Options:
-h,--help You are here.
--foo Enable foo.
$ ./example.js --foo some example values
foo is enabled
bar is some, example, valuesDocumentation
API documentation can be found here.