Installation
$ npm install mergeable
Usage
Create a new Mergable object:
var Mergeable = ; var config = a: 'b' ;config; var copy = config;console;
Interface
// initialize with datavar // deep merge configConfig.prototype.deepMerge = function( Object data ) // deep merge config from pathConfig.prototype.deepMergeFromPath = function( String path ) // shallow merge configConfig.prototype.shallowMerge = function( Object data ) // shallow merge config from pathConfig.prototype.shallowMergeFromPath = function( String path ) // clear and replace configConfig.prototype.replace = function( Object data ) // replace config from pathConfig.prototype.replaceFromPath = function( String path ) // clear all settings from this instanceConfig.prototype.clear = function() // strip out all functions etc and produce a copyConfig.prototype.export = function() // return pretty formatting for easy readingConfig.prototype.stringify = function()
NPM Module
The mergeable
npm module can be found here:
https://npmjs.org/package/mergeable
Contributing
Please fork and pull request against upstream master on a feature branch.
Pretty please; provide unit tests and script fixtures in the test
directory.
Running Unit Tests
$ npm test
Continuous Integration
Travis tests every release against node version 0.10