clie
Stability: 1 - Experimental
Evented command-line.
Usage
Programmatically
Enable
// your module main.js"use strict"; var clie = path = ; var commandsDirectory = path; moduleexports = ;
Use
// module that uses your modulevar myModule = ;myModulecommands // has all the commands
Command-Line
Use
Call cli()
on required module.
// your module cli.js#!/usr/bin/env node"use strict"; var commandEmitter = ; commandEmitter; commandEmitter;
Create a command
// commands/one.js"use strict"; var clie = ; var one = moduleexports = clie; oneusage = "\nUsage: my-module one" "" "Displays 'one'";
Reuse commands within commands
To require
the module the command belongs to, it must be called within the command body as depicted below (var myModule = require('../index.js')
).
"use strict"; var clie = ; var two = moduleexports = clie; twousage = "\nUsage: my-module two [options]" " options: --one (Display 'one' instead of 'two')";
Releases
We follow semantic versioning policy (semver.org) with a caveat:
Given a version number MAJOR.MINOR.PATCH, increment the:
MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.
caveat: Major version zero is a special case indicating development version that may make incompatible API changes without incrementing MAJOR version.