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, coords: { x: 0, y: 0 }, data: [1, 2, 3]} //the very common use-casefunction MyClass(options){ this.options = sextend(options || {}, defaults);}