0.5.2 • Published 6 years ago

toolsmith v0.5.2

Weekly downloads
1
License
Apache-2.0
Repository
gitlab
Last release
6 years ago

Toolsmith Toolsmith

npm version pipeline status coverage status standard-js conventional commits

Yet another CLI tool framework.

Installation

npm install toolsmith

Basic 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, values

Documentation

API documentation can be found here.

0.5.2

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago