Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Rikezenho
Last active February 11, 2019 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rikezenho/8f4ba1db2f79738a74d3675dfba740c0 to your computer and use it in GitHub Desktop.
Save Rikezenho/8f4ba1db2f79738a74d3675dfba740c0 to your computer and use it in GitHub Desktop.
CLI tutorial - step 1
#!/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