Last active
February 11, 2019 11:01
-
-
Save Rikezenho/8f4ba1db2f79738a74d3675dfba740c0 to your computer and use it in GitHub Desktop.
CLI tutorial - step 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const program = require('commander'); | |
const package = require('./package.json'); | |
program.version(package.version); | |
program | |
.command('add [todo]') | |
.description('Adiciona um to-do') | |
.action((todo) => { | |
console.log(todo); | |
}); | |
program.parse(process.argv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment