Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (19 sloc) 622 Bytes


objbind takes an object and returns an object that inherits from it with all the enumerable functions bound to the first object. confused? here's an example:

var winston = require('winston')
  , objbind = require('objbind')
  , myWinston = objbind(winston, 'nathan says')'hi')
console.log(myWinston.loggers === winston.loggers)


info: nathan says hi

objbind(obj, args...)

  • newObj = Object.create(obj)
  • for each enumerable function property of obj, assign fn.bind(obj, args...) to the same key on newObj
  • return newObj