Skip to content

Instantly share code, notes, and snippets.

@knksmith57
Created September 15, 2017 17:00
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 knksmith57/e433fa7416e8530427a4054cfa22b5d3 to your computer and use it in GitHub Desktop.
Save knksmith57/e433fa7416e8530427a4054cfa22b5d3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
'use strict'
require('yargs')
.command('hello <name>', 'say hello to <name>', {}, yargs => {
console.log(`hello, ${yargs.name}!`)
})
.demandCommand(1)
.help()
.argv
{
"bin": {
"hello": "bin/hello.js"
},
"scripts": {
"lint": "eslint *.js **/*.js | snazzy"
},
"eslintConfig": {
"extends": "standard",
"overrides": [
{
"files": ["bin/*.js"],
"rules": {
"no-unused-expressions": 0
}
}
]
},
"devDependencies": {
"eslint": "^4",
"eslint-config-standard": "^10",
"eslint-plugin-import": "^2",
"eslint-plugin-node": "^5",
"eslint-plugin-promise": "^3",
"eslint-plugin-standard": "^3",
"snazzy": "^7"
},
"dependencies": {
"yargs": "^8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment