pascaliske/modern-cli
Library for class based modern cli scripts.
Write modern node cli scripts using ES6 classes.
Install
$ yarn add modern-cli
Basic Usage
Here are some basic examples for the usage. For more information see the docs.
Using functions
./examples/basic.js
:
; 'script' '1.0.1' ;
Now you can use the script in one of the following ways:
$ babel-node ./examples/basic.js command$ ./examples/basic.js --help
Using a dedicated command class
./examples/basic2.js
:
;; 'script' ;
./examples/mycommand.js
:
; /** * Initializes the cli command */ { super'mycommand' 'Some helpful description of "mycommand".'; } async { // here comes your code which should be executed by this command }
Again, you can use the script in one of the following ways:
$ ./examples/basic2.js mycommand
$ ./examples/basic2.js --help
License
MIT © Pascal Iske