Skip to content

Instantly share code, notes, and snippets.

@stelcheck
Last active April 22, 2017 09:59
Show Gist options
  • Save stelcheck/d8fb8c617eebc3df8351dff2e8aeedd8 to your computer and use it in GitHub Desktop.
Save stelcheck/d8fb8c617eebc3df8351dff2e8aeedd8 to your computer and use it in GitHub Desktop.
Extracting NPM command arguments from within an NPM script
var npmArgs = JSON.parse(process.env.npm_config_argv);
if (npmArgs.original.indexOf('--bootstrap') === -1) {
process.exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment