Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/l-chris/fcmd

a improved version of commander.js
https://github.com/l-chris/fcmd

command-line-tool commanderjs nodejs

Last synced: about 2 months ago
JSON representation

a improved version of commander.js

Awesome Lists containing this project

README

        

# fcmd
a improved version of commander.js

- more readable code structure
- imporve sub command
- most importantly, less bug!

# Usage
```javascript
const program = require('fcmd');

program
.version('0.0.1') // default to version in package.json
.description('a demo cli')
.option('-u --username ', 'username') // global option
.option('-p --password ', 'password') // global option
.action(() => console.log(1)); // precommand action

program
.command('test')
.option('-p --port', 'port option for test subcommand', parseInt, 8080)
.action((argv, args) => {
// do sth...
});

program
.command('print')
.option('-t --text', 'text option for test subcommand')
.action((argv, args) => {
// do sth...
});
```