node-parameter-handler
v2.0.1
Published
build JSON files which can be used as settings
Downloads
7
Maintainers
Readme
node.js parameter handler
can be used as config builder, inspired by @Incenteev/ParameterHandler useful for 'legacy' applications, if you're using react-scripts@3, consider use .env file instead, as in this example repository
how to install
$ npm i node-parameter-handler
or $ yarn add node-parameter-handler
software requirements
used technologies
- jest - only for tests
used services
how to execute
$ node_modules/.bin/node-parameter-handler
how to execute tests
$ npm test
- to execute tests with coverage
npm test -- --coverage
how to use
include configs into root package.json into 'extra' node
observe an example of package.json
{
...
"extra": {
"node_parameter_handler": [
{
"source": "tests/fixtures/settings.json.dist", # source
"output": "var/settings1.json", # output
"envMap": {
"touched": "BASE_URL", # json path to ENV VARIABLE
"test.touched": "PWD",
"test.test.touched": "HOME"
}
},
{
"source": "tests/fixtures/settings.json.dist", # source
"output": "var/settings2.json", # output
"skipUndefined": true, # if variable is not defined do not change
"envMap": {
"touched": "BASE_URL", # json path to ENV VARIABLE
"test.touched": "PWD",
"test.test.touched": "HOME"
}
}
]
}
}