
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-nmconfig
Advanced tools
Handy and strongly opinionated config helper on top of reconfig.
Here in Namshi we like our configuration: incremental, overridable, and defined in a compact way.
As well as we like to don't go nuts when we clone a project repo for the 1st time.
This is why we came up with tools like reconfig and file-ensure. With nmConfig we put all this things together in a convenient lib that turns all of this in a matter of a require() instruction.
config/ directory and the needed files if they are not present:config/
|- base.yml
|- dev.example.yml
|- staging.yml
|- live.yml
base.yml one:
#base.yml
characters:
yoda: jedi
anakin: jedi
obiWan: jedi
#dev.yml
characters:
anakin: sith
will result in:
{
characters: {
yoda: 'jedi',
anakin: 'sith',
obiWan: 'jedi'
}
}
You can eventually define configuration paths in your app's package.json too, using your app's name as key,
and they'll be added to the final configuration:
// Put something like this in your package.json
{
"name": "myConfigurableApp",
"version": "0.0.1",
"description": "I can configure apps",
"myConfigurableApp": {
"characters": {
"benSolo": "sith"
}
}
// and you'll obtain:
{
characters: {
yoda: 'jedi',
anakin: 'sith',
obiWan: 'jedi',
benSolo: 'sith'
}
}
reconfig instance:console.log(config.get('characters.anakin'));
// ==> 'sith'
reconfig's env overrider prefix from your package.json://pacakage.json
{
"name": "myApp",
"version": "0.1.0",
"description": "this is my app, there are many like it, but this one is mine!"
// [...]
}
will yield a MYAPP_CONFIG env prefix for reconfig (check this section on reconfig's doc for more infos on what this does)
dev.yml on your dev machine, or eventually creates one from dev.example.ymlOptions parameters:
baseFiles: A list of files creating the base configuration before applying the environment specific config. These files will be merged in order, the env file will be the last applied.
separator: The separator Reconfig will use for console vars overlays.
projectName: Defines Your project's name. If none is given, the project's name will be inferred form your package.json "name" value. All spaces will be removed.
prefix: The prefix that Reconfig will use while grabbing console variable and applying overlays.
ensure: Tells to nmConfig to check for the existence of .yml file. If a .example.yml is found, it will be used to produce the ensured file.
env: Forced value for the environment:
by default nmConfig will read you env form:
- PROJECTNAME_ENV
- NODE_ENV
- or default to "dev"
NOTE: If you want to output the value of your system configuration on loading your config then you can set an option in your environment config file with a value of verboseConfig: true at the top level. If this is set then the config will be printed to STDOUT.
Install this library via NPM:
npm install node-nmconfig
var config = require('node-nmconfig')();
// or
var config = require('node-nmconfig')({ /* options */ });
If you need it on the client side we highly recommend browserify.
This library is a little convenience wrapper on top of extensively tested projects,
so for once we can be a little bit lazy and skip them ;)
We do like tests tho, so if you feel giving us a hand we'll be more than happy
to see some PR love on this side :D
FAQs
Reconfig based Namshi style config files helper
The npm package node-nmconfig receives a total of 27 weekly downloads. As such, node-nmconfig popularity was classified as not popular.
We found that node-nmconfig 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.