zz 65c8a28f48 项目初始化 vor 2 Tagen
..
test 65c8a28f48 项目初始化 vor 2 Tagen
.travis.yml 65c8a28f48 项目初始化 vor 2 Tagen
LICENSE 65c8a28f48 项目初始化 vor 2 Tagen
README.md 65c8a28f48 项目初始化 vor 2 Tagen
index.js 65c8a28f48 项目初始化 vor 2 Tagen
package.json 65c8a28f48 项目初始化 vor 2 Tagen

README.md

ngraph.merge

Simple merge utility to extend objects without extra dependencies. This utility may be useful when you want to quickly provide optional settings

build status

usage

  var merge = require('ngraph.merge');
  var options = { age: 42 };
  merge(options, { name: 'John' });
  console.log(options); // { age: 42, name: 'John'}

  merge(options, { age: 100 });
  console.log(options.age); // 42. Options already has age defined

  merge(options, {age: '100'});
  console.log(options.age); // '100'. Type mismatch. Age is overwritten

For more examples please refer to tests.

why?

I want to control dependencies chain and not pull too many external libraries into ngraph.

install

With npm do:

npm install ngraph.merge

license

MIT