{"_id":"component-bind","_rev":"31-9682f27a16ef95b6c03e7441e7d80595","name":"component-bind","description":"function binding utility","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"component-bind","version":"1.0.0","description":"function binding utility","keywords":["bind","utility"],"devDependencies":{"mocha":"*","should":"*"},"component":{"scripts":{"bind/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/bind.git"},"bugs":{"url":"https://github.com/component/bind/issues"},"homepage":"https://github.com/component/bind","_id":"component-bind@1.0.0","_shasum":"00c608ab7dcd93897c0009651b1d3a8e1e73bbd1","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"00c608ab7dcd93897c0009651b1d3a8e1e73bbd1","tarball":"https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz"},"directories":{}}},"readme":"# bind\n\n  Function binding utility.\n\n## Installation\n\n```\n$ component install component/bind\n```\n\n## API\n\n   - [bind(obj, fn)](#bindobj-fn)\n   - [bind(obj, fn, ...)](#bindobj-fn-)\n   - [bind(obj, name)](#bindobj-name)\n<a name=\"\"></a>\n \n<a name=\"bindobj-fn\"></a>\n### bind(obj, fn)\nshould bind the function to the given object.\n\n```js\nvar tobi = { name: 'tobi' };\n\nfunction name() {\n  return this.name;\n}\n\nvar fn = bind(tobi, name);\nfn().should.equal('tobi');\n```\n\n<a name=\"bindobj-fn-\"></a>\n### bind(obj, fn, ...)\nshould curry the remaining arguments.\n\n```js\nfunction add(a, b) {\n  return a + b;\n}\n\nbind(null, add)(1, 2).should.equal(3);\nbind(null, add, 1)(2).should.equal(3);\nbind(null, add, 1, 2)().should.equal(3);\n```\n\n<a name=\"bindobj-name\"></a>\n### bind(obj, name)\nshould bind the method of the given name.\n\n```js\nvar tobi = { name: 'tobi' };\n\ntobi.getName = function() {\n  return this.name;\n};\n\nvar fn = bind(tobi, 'getName');\nfn().should.equal('tobi');\n```\n\n## License \n\n  MIT","maintainers":[{"email":"shtylman@gmail.com","name":"defunctzombie"},{"email":"df.creative@gmail.com","name":"dfcreative"},{"email":"nathan@tootallnate.net","name":"tootallnate"},{"email":"tj@vision-media.ca","name":"tjholowaychuk"},{"email":"rauchg@gmail.com","name":"rauchg"},{"email":"rdsuarez@gmail.com","name":"retrofox"},{"email":"thecoreh@gmail.com","name":"coreh"},{"email":"forbes@lindesay.co.uk","name":"forbeslindesay"},{"email":"kelonyemitchel@gmail.com","name":"kelonye"},{"email":"mattmuelle@gmail.com","name":"mattmueller"},{"email":"yields@icloud.com","name":"yields"},{"email":"antshort@gmail.com","name":"anthonyshort"},{"email":"jonathanrichardong@gmail.com","name":"jongleberry"},{"email":"ian@ianstormtaylor.com","name":"ianstormtaylor"},{"email":"cristiandouce@gmail.com","name":"cristiandouce"},{"email":"arpad.borsos@googlemail.com","name":"swatinem"},{"email":"gstagas@gmail.com","name":"stagas"},{"email":"amjad.masad@gmail.com","name":"amasad"},{"email":"julian@juliangruber.com","name":"juliangruber"},{"email":"calvin@calv.info","name":"calvinfo"},{"email":"dominic@dbarnes.info","name":"dominicbarnes"},{"email":"clint@anotherway.co.za","name":"clintwood"},{"email":"dnfagnan@gmail.com","name":"thehydroimpulse"},{"email":"me@stephenmathieson.com","name":"stephenmathieson"},{"email":"trevorgerhardt@gmail.com","name":"trevorgerhardt"},{"email":"timaschew@gmail.com","name":"timaschew"},{"email":"hughskennedy@gmail.com","name":"hughsk"}],"time":{"modified":"2017-05-22T20:52:54.317Z","created":"2014-05-27T23:07:10.856Z","1.0.0":"2014-05-27T23:07:10.856Z"},"homepage":"https://github.com/component/bind","keywords":["bind","utility"],"repository":{"type":"git","url":"https://github.com/component/bind.git"},"bugs":{"url":"https://github.com/component/bind/issues"},"readmeFilename":"Readme.md","_attachments":{},"_etag":"W/\"59234fa6-f3e\"","_lastModified":"Mon, 22 May 2017 20:52:54 GMT","_cached":true}