Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/extend-functions
https://github.com/zkochan/extend-functions
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zkochan/extend-functions
- Owner: zkochan
- License: mit
- Created: 2015-07-28T15:50:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T19:49:01.000Z (about 8 years ago)
- Last Synced: 2024-11-29T11:01:55.076Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# extend-functions
Extends a target objects with functions from the source object, keeping the context of the source object.
[![Dependency Status](https://david-dm.org/zkochan/extend-functions/status.svg?style=flat)](https://david-dm.org/zkochan/extend-functions)
[![Build Status](https://travis-ci.org/zkochan/extend-functions.svg?branch=master)](https://travis-ci.org/zkochan/extend-functions)
[![npm version](https://badge.fury.io/js/extend-functions.svg)](http://badge.fury.io/js/extend-functions)## Installation
```
npm install --save extend-functions
```## Usage
```js
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