{"id":15689693,"url":"https://github.com/jonschlinkert/deep-bind","last_synced_at":"2025-05-07T23:06:26.690Z","repository":{"id":57211758,"uuid":"50092947","full_name":"jonschlinkert/deep-bind","owner":"jonschlinkert","description":"Bind a context to all functions in an object, including deeply nested functions.","archived":false,"fork":false,"pushed_at":"2019-07-11T07:09:20.000Z","size":11,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T23:06:21.133Z","etag":null,"topics":["bind","context","function","javascript","nodejs","object"],"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/jonschlinkert.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"2016-01-21T08:23:27.000Z","updated_at":"2024-09-22T16:18:46.000Z","dependencies_parsed_at":"2022-09-07T06:50:26.766Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/deep-bind","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdeep-bind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdeep-bind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdeep-bind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdeep-bind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/deep-bind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833251,"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":["bind","context","function","javascript","nodejs","object"],"created_at":"2024-10-03T18:04:06.404Z","updated_at":"2025-05-07T23:06:26.669Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# deep-bind [![NPM version](https://img.shields.io/npm/v/deep-bind.svg?style=flat)](https://www.npmjs.com/package/deep-bind) [![NPM downloads](https://img.shields.io/npm/dm/deep-bind.svg?style=flat)](https://npmjs.org/package/deep-bind) [![Build Status](https://img.shields.io/travis/jonschlinkert/deep-bind.svg?style=flat)](https://travis-ci.org/jonschlinkert/deep-bind)\n\n\u003e Bind a context to all functions in an object, including deeply nested functions.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install deep-bind --save\n```\n\n## Usage\n\n```js\nvar deepBind = require('deep-bind');\n```\n\n**Example**\n\nBind a context to an object of template helpers before passing them to an engine:\n\n```js\nvar ctx = {\n  app: {views: {}},\n  context: {a: 'b'}\n};\n\n// pass the following to the template engine\nvar helpers = deepBind({\n  foo: function() {\n    return this.context;\n  },\n  bar: function() {},\n  baz: function() {}\n}, ctx);\n```\n\n## API\n\n### [deepBind](index.js#L14)\n\nBind a `thisArg` to all the functions on the target\n\n**Params**\n\n* `target` **{Object|Array}**: Object or Array with functions as values that will be bound.\n* `thisArg` **{Object}**: Object to bind to the functions\n* `returns` **{Object|Array}**: Object or Array with bound functions.\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/deep-bind/issues/new).\n\n## Building docs\n\nGenerate readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install verb \u0026\u0026 npm run docs\n```\n\nOr, if [verb](https://github.com/verbose/verb) is installed globally:\n\n```sh\n$ verb\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/jonschlinkert/deep-bind/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 02, 2016._","funding_links":[],"categories":["Modules","模块"],"sub_categories":["Function","函数"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fdeep-bind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fdeep-bind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fdeep-bind/lists"}