Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@myob-oss/config
Advanced tools
A simple, predictable configuration module for Node.js applications.
This uses the environment variable NODE_ENV to determine which configuration file to load.
The module assumes that all the configuration files in JSON are in the /config
folder at the top level of the project. The JSON files can have comments in them, as the module uses the json5 module to parse the config files.
The module loads 3 configuration files in the following order (each overwrites the previous if they have the same key):
Each configuration file will override values from the previous file. For example:
default.json
{
"foo": "bar",
"hello": "there"
}
production.json
{
"my": "goodness"
}
runtime.json
{
"foo": "baz",
"au": "revoir"
}
The resulting config will be:
{
"foo": "baz",
"hello": "there",
"au": "revoir",
"my": "goodness"
}
This uses the deepmerge module to do the merging of the configuration objects.
To use the module, you simply require it, and it exposes the configuration as an Object.
const config = require('@myob-oss/config');
console.log(config.foo); // prints "baz" from the example above.
To run the tests use the following command.
npm test
To run the coverage scanner and generate coverage report use the following command. It fails if the threshold coverage has not passed. The threshold settings are stored in test/.istanbul.yml
.
npm run cover
To run the linting checking run the following command.
npm run lint
FAQs
A simple, slightly opinionated, and predictable configuration module for Node.js applications.
The npm package @myob-oss/config receives a total of 43 weekly downloads. As such, @myob-oss/config popularity was classified as not popular.
We found that @myob-oss/config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.