obj-extend

Extend objects easily in node.js

1 个版本
安装
npm install obj-extend
yarn add obj-extend
pnpm add obj-extend
bun add obj-extend
README

obj-extend

When called, this module simply sets all of the properties of each source object onto the destination object (the first argument). Every property with the same name is overridden in the order in which they were passed.

Installation

$ npm install obj-extend

Usage

var extend = require('obj-extend');

var Person = function (name) {
  this.name = name;
};

Person.prototype = extend(events.EventEmitter.prototype, {

  emitName: function () {
    this.emit('name', this.name);
  }

});
版本列表
0.1.0 2012-10-19