Skip to content

Instantly share code, notes, and snippets.

@sangress
Created January 29, 2017 09:23
Show Gist options
  • Save sangress/a50edfb1e54a02235323977570e47038 to your computer and use it in GitHub Desktop.
Save sangress/a50edfb1e54a02235323977570e47038 to your computer and use it in GitHub Desktop.
get arguments for node.js (requires lodash), supports arguments that passed with `--arg=value`
module.exports = (args) => {
return _.chain(args).map(arg => {
let argProps = arg.replace('--', '').split('=');
return argProps;
}).fromPairs().value();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment