Created
January 29, 2017 09:23
-
-
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`
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
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