Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/l-chris/fcmd
- Owner: L-Chris
- License: mit
- Created: 2018-11-15T07:06:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T05:53:50.000Z (about 6 years ago)
- Last Synced: 2024-08-10T23:11:30.134Z (5 months ago)
- Topics: command-line-tool, commanderjs, nodejs
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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 actionprogram
.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...
});
```