Skip to content

jsspec/cli-options

Repository files navigation

@jsspec/cli-options

Travis AppVeyor

Command line options parser for jsspec.

Example:

const CLIOptions = require('@jsspec/cli-options')

options = {
  random: { alias: 'R', type: Boolean, required: false, default: true },
  require: { alias: 'r', type: Array, required: false, default: [] },
  format: { alias: 'f', type: String, required: false, default: 'documentation' },
  files: { type: Array, required: false, default: [] }
};

const cliOptions = new CLIOptions(process.argv.slice(2), options, 'files');
const settings = cliOptions.settings;

console.log(cliOptions.errors.join('\n'));

About

Simplified command line option parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published