node-extend

0.2.0 • Public • Published

extend

extend for node.js

example

function A(){
	this.name = 'brighthas | leo';
}

A.prototype.getName = function(){
	return this.name;
}

function B(){
	this.age = 31;
}

B.prototype.getAge = function(){
	return this.age;
}


var extend = require('node-extend');
var A2 = extend(A,B); // A extend B.
var a = new A2();
console.log(a.getName());  // brighthas | leo
console.log(a.getAge());   // 31

install

npm install node-extend

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i node-extend

      Weekly Downloads

      307

      Version

      0.2.0

      License

      MIT

      Last publish

      Collaborators

      • brighthas