soft-extend

Non-destructive extend. Just appends new properties to an object, keeping old ones.


Keywords
extend, xtend, inherits, utils, append, merge
License
Unlicense
Install
npm install soft-extend@0.1.1

Documentation

Soft-extend

Extend any object softly, i. e. do not replace existing properties, just append the new ones.

var sextend = require('soft-extend');

var defaults = {
	intensity: 100,
	hold: true
}

//the very common use-case
function MyClass(options){
	this.options = sextend(options || {}, defaults);
}

NPM