
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
merge-settings
Advanced tools
Load and merge configuration settings from multiple sources, in a specific order, and normalized according to a schema.
Load and merge configuration settings from multiple sources, in a specific order, and normalized according to a schema.
Install with npm:
$ npm install merge-settings --save
var Settings = require('merge-settings');
Create an instance of Settings with the given options.
Params
options {Object}Example
var settings = new Settings();
Add a config object to be merged.
Params
object {Object}: The object to merge into the config.Example
config
.addConfig({a: 'b', c: 'd'})
.addConfig({a: 'z'})
.merge();
//=> {a: 'z', c: 'd'}
Get the normalized value of property key from the cache.
Params
key {String}returns {any}: The normalized value of keyExample
config.get('foo');
Get the raw (non-normalized) value of property key from the cache.
Params
key {String}returns {any}: The value of keyExample
config.get('foo');
Add a config object to be merged.
Params
object {Object}: The object to merge into the config.Example
config
.addConfig({a: 'b', c: 'd'})
.addConfig({a: 'z'})
.merge();
//=> {a: 'z', c: 'd'}
Add an array or list of config objects to be merged.
Params
object {Object}: The object to merge into the config.Example
config
.addConfigs({a: 'b'}, {c: 'd'})
.addConfigs([{a: 'b'}, {c: 'd'}])
Merge the given (optional) config object with cached config objects in the order in which the objects were defined. If a normalize function is passed on the contructor options, or as the first or second argument to .merge, it will be used on each config object before merging it onto the results object.
Params
config {Object}Example
var settings = new Settings()
.set('foo', {a: 'b'})
.set('bar', {c: 'd'})
.set('baz', {e: 'f'})
.merge();
console.log(settings);
//=> {a: 'b', c: 'd', e: 'f'}
// Pass a normalize function on the
// ctor options, or to .merge as first or second arg
var settings = new Settings()
.set('foo', {a: 'b'})
.set('bar', {c: 'd'})
.set('baz', {e: 'f'})
.merge(function(config) {
// normalize config object
});
console.log(settings);
//=>
You might also be interested in these projects:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on April 07, 2016.
FAQs
Load and merge configuration settings from multiple sources, in a specific order, and normalized according to a schema.
We found that merge-settings 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.