
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
config-load
Advanced tools
npm install config-load
var configLoad = require('config-load');
Loads all JS/JSON config files under path, recursively gathering them from the tree structure.
Uses require-folder-tree - see docs for that for explanation of how files are loaded.
If path is not provided, defaults to process.cwd() + '/config'
.
Environment type - creates a selector (see below).
Defaults to process.env.NODE_ENV || 'development'
Object determining what parts of the config object to switch dependent on selectors provided.
Defaults to { env: options.env }
If config file parsing produces:
{
db: {
server: 'localhost',
database: 'myDB'
},
env: {
development: {
db: {
password: 'dev db password'
}
},
production: {
db: {
password: 'production db password'
}
}
},
otherSetting: 'foo'
}
Then calling:
configLoad(path, { selectors: { env: 'development' } } )
returns:
{
db: {
server: 'localhost',
database: 'myDB',
password: 'dev db password'
},
otherSetting: 'foo'
}
null
valueIf a selector
's value is null
, it takes the name
key only.
If config file parsing produces:
{
url: 'http://example.com/',
local: {
url: 'http://mysite.com/'
}
}
configLoad(path, { selectors: { local: null } } )
returns:
{
url: 'http://mysite.com/'
}
Use npm test
to run the tests. Use npm run cover
to check coverage.
See changelog.md
If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/config-load/issues
Pull requests are very welcome. Please:
0.1.1
null
selectorsFAQs
Load config from a tree of JS/JSON files
The npm package config-load receives a total of 1 weekly downloads. As such, config-load popularity was classified as not popular.
We found that config-load demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.