index.js (822B)
1 const { Argument } = require('./lib/argument.js'); 2 const { Command } = require('./lib/command.js'); 3 const { CommanderError, InvalidArgumentError } = require('./lib/error.js'); 4 const { Help } = require('./lib/help.js'); 5 const { Option } = require('./lib/option.js'); 6 7 /** 8 * Expose the root command. 9 */ 10 11 exports = module.exports = new Command(); 12 exports.program = exports; // More explicit access to global command. 13 // createArgument, createCommand, and createOption are implicitly available as they are methods on program. 14 15 /** 16 * Expose classes 17 */ 18 19 exports.Command = Command; 20 exports.Option = Option; 21 exports.Argument = Argument; 22 exports.Help = Help; 23 24 exports.CommanderError = CommanderError; 25 exports.InvalidArgumentError = InvalidArgumentError; 26 exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated