Nitrogen Peroxide Monoxide
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

haybale

1.0.1 • Public • Published

haybale

decorate an object prototype with the methods of an object

use

var decorate = require("haybale");
 
 
// model prototype
var model = {
 
  name: "hello"
 
}
 
// object with methods
var obj = {
  run: function () {
    console.log("running");
  },
  end: function () {
    console.log("ending");
  }
};
 
 
decorate(model, obj);
 
model.run();
 
model.end();
 

api

haybale exposes a single function

decorate(fn, obj)

params

model: the object prototype to be decorated

obj: the object with which to decorate the model

install

npm i haybale

Downloadsweekly downloads

1

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability