Skip to content

Instantly share code, notes, and snippets.

@mewwts
Last active August 29, 2015 14:14
Show Gist options
  • Save mewwts/1e20dc4caf23747faf31 to your computer and use it in GitHub Desktop.
Save mewwts/1e20dc4caf23747faf31 to your computer and use it in GitHub Desktop.
Default command line arguments in Node.js
var _ = require('lodash');
var argv = _.assign(
require('./defaults'),
require('minimist')(process.argv.slice(2))
);
console.log(argv);
{
"port": 8080,
"logLevel": "error",
"path1": "http://localhost:9200"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment