extend-functions

0.1.0 • Public • Published

extend-functions

Extends a target objects with functions from the source object, keeping the context of the source object.

Dependency Status Build Status npm version

Installation

npm install --save extend-functions

Usage

var extendFunctions = require('extend-functions');
 
var source = {
  msg: 'Hello world!',
  log: function() {
    console.log(this.msg);
  }
};
var target = {};
 
extendFunctions(target, source);
 
target.log(); /* Will print `Hello world!` */

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i extend-functions

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • zkochan