Expands environment variables in command line parameters, then executes the command.
npm install addenv-cli --save-dev
Useful when using npm as a build tool.
{
"private": true,
"devDependencies": {
"addenv-cli": "^0.1.0"
},
"config": {
"foo": "\"{{bar}}\"",
"bar": "baz"
},
"scripts": {
"build": "addenv \"echo Foo expands to: {{foo}}\""
}
}
npm run build
Foo expands to: "baz"
- 0.1.0: Changed syntax to
{{var}}
to avoid native variable expansion; Added"
escaping. - 0.0.1: Initial version