{"id":20780107,"url":"https://github.com/xotic750/bind-x","last_synced_at":"2026-04-18T20:32:41.250Z","repository":{"id":22546862,"uuid":"93898194","full_name":"Xotic750/bind-x","owner":"Xotic750","description":"Creates a new function with a bound sequence of arguments.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:54:50.000Z","size":2676,"stargazers_count":0,"open_issues_count":21,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T09:38:49.376Z","etag":null,"topics":["bind","browser","function","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","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/Xotic750.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":"2017-06-09T21:29:35.000Z","updated_at":"2020-01-30T23:09:16.000Z","dependencies_parsed_at":"2023-01-13T22:03:50.617Z","dependency_job_id":null,"html_url":"https://github.com/Xotic750/bind-x","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fbind-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fbind-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fbind-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fbind-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xotic750","download_url":"https://codeload.github.com/Xotic750/bind-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243123493,"owners_count":20240030,"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","browser","function","javascript","nodejs"],"created_at":"2024-11-17T13:32:15.071Z","updated_at":"2026-04-18T20:32:40.278Z","avatar_url":"https://github.com/Xotic750.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca\n  href=\"https://travis-ci.org/Xotic750/bind-x\"\n  title=\"Travis status\"\u003e\n\u003cimg\n  src=\"https://travis-ci.org/Xotic750/bind-x.svg?branch=master\"\n  alt=\"Travis status\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://david-dm.org/Xotic750/bind-x\"\n  title=\"Dependency status\"\u003e\n\u003cimg src=\"https://david-dm.org/Xotic750/bind-x/status.svg\"\n  alt=\"Dependency status\" height=\"18\"/\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://david-dm.org/Xotic750/bind-x?type=dev\"\n  title=\"devDependency status\"\u003e\n\u003cimg src=\"https://david-dm.org/Xotic750/bind-x/dev-status.svg\"\n  alt=\"devDependency status\" height=\"18\"/\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://badge.fury.io/js/bind-x\"\n  title=\"npm version\"\u003e\n\u003cimg src=\"https://badge.fury.io/js/bind-x.svg\"\n  alt=\"npm version\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://www.jsdelivr.com/package/npm/bind-x\"\n  title=\"jsDelivr hits\"\u003e\n\u003cimg src=\"https://data.jsdelivr.com/v1/package/npm/bind-x/badge?style=rounded\"\n  alt=\"jsDelivr hits\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://bettercodehub.com/results/Xotic750/bind-x\"\n  title=\"bettercodehub score\"\u003e\n\u003cimg src=\"https://bettercodehub.com/edge/badge/Xotic750/bind-x?branch=master\"\n  alt=\"bettercodehub score\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://coveralls.io/github/Xotic750/bind-x?branch=master\"\n  title=\"Coverage Status\"\u003e\n\u003cimg src=\"https://coveralls.io/repos/github/Xotic750/bind-x/badge.svg?branch=master\"\n  alt=\"Coverage Status\" height=\"18\"\u003e\n\u003c/a\u003e\n\n\u003ca name=\"module_bind-x\"\u003e\u003c/a\u003e\n\n## bind-x\n\nCreates a new function with a bound sequence of arguments.\n\n\u003ca name=\"exp_module_bind-x--module.exports\"\u003e\u003c/a\u003e\n\n### `module.exports` ⇒ \u003ccode\u003efunction\u003c/code\u003e ⏏\n\nThe bind() method creates a new function that, when called, has its this\nkeyword set to the provided value, with a given sequence of arguments\npreceding any provided when the new function is called.\n\n**Kind**: Exported member  \n**Returns**: \u003ccode\u003efunction\u003c/code\u003e - The bound function.  \n**Throws**:\n\n- \u003ccode\u003eTypeError\u003c/code\u003e If target is not a function.\n\n| Param   | Type                  | Description                                                                                                                                                                              |\n| ------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| target  | \u003ccode\u003efunction\u003c/code\u003e | The target function.                                                                                                                                                                     |\n| thisArg | \u003ccode\u003e\\*\u003c/code\u003e       | The value to be passed as the this parameter to the target function when the bound function is called. The value is ignored if the bound function is constructed using the new operator. |\n| [args]  | \u003ccode\u003e...\\*\u003c/code\u003e    | Arguments to prepend to arguments provided to the bound function when invoking the target function.                                                                                      |\n\n**Example**\n\n```js\nimport bind from 'bind-x';\n\nthis.x = 9; // this refers to global \"window\" object here in the browser\nconst module = {\n  x: 81,\n  getX: function() {\n    return this.x;\n  },\n};\n\nconsole.log(module.getX()); // 81\n\nconst retrieveX = module.getX;\nconsole.log(retrieveX());\n// returns 9 - The function gets invoked at the global scope\n\n// Create a new function with 'this' bound to module\n// New programmers might confuse the\n// global var x with module's property x\nconst boundGetX = bind(retrieveX, module);\nconsole.log(boundGetX()); // 81\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxotic750%2Fbind-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxotic750%2Fbind-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxotic750%2Fbind-x/lists"}