Skip to content
Myr

Add program to exports (#1195)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by GitHub · parent 77e511f · Browse files · 3 files+22 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+22 added−1 removed

  • tests:+20 added−0 removed
  • other:+2 added−1 removed

3 files+22 added−1 removed

added:tests/program.test.js+20 added
modified:index.js+1 added
1531 unmodified lines
1532 * Expose the root command.1533 */15341535exports = module.exports = new Command();1536exports.program = exports; // More explicit access to global command.15371538/**1539 * Expose classes1540 */
155 unmodified lines
modified:Readme.md+1 added-1 removed
54 unmodified lines
55Commander exports a global object which is convenient for quick programs.56This is used in the examples in this README for brevity.5758```js59const program = require('commander');59const program = require('commander').program;60program.version('0.0.1');61```6263For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.
660 unmodified lines