{"id":23053447,"url":"https://github.com/component/bind","last_synced_at":"2025-05-07T15:23:08.142Z","repository":{"id":4273271,"uuid":"5401362","full_name":"component/bind","owner":"component","description":"Function binding utility","archived":false,"fork":false,"pushed_at":"2022-04-15T15:56:10.000Z","size":181,"stargazers_count":20,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T18:59:39.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/component.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-13T16:12:43.000Z","updated_at":"2025-01-22T20:09:35.000Z","dependencies_parsed_at":"2022-09-11T17:03:55.293Z","dependency_job_id":null,"html_url":"https://github.com/component/bind","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fbind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fbind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fbind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fbind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/component","download_url":"https://codeload.github.com/component/bind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252903132,"owners_count":21822377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T00:18:14.134Z","updated_at":"2025-05-07T15:23:08.123Z","avatar_url":"https://github.com/component.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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\u003ca name=\"\"\u003e\u003c/a\u003e\n \n\u003ca name=\"bindobj-fn\"\u003e\u003c/a\u003e\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\u003ca name=\"bindobj-fn-\"\u003e\u003c/a\u003e\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\u003ca name=\"bindobj-name\"\u003e\u003c/a\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fbind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomponent%2Fbind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fbind/lists"}