{"id":40703416,"url":"https://github.com/sourcevault/bindall","last_synced_at":"2026-01-21T12:07:52.257Z","repository":{"id":57118438,"uuid":"100620787","full_name":"sourcevault/bindall","owner":"sourcevault","description":"bindall reassign .this to fixed object for selected functions - with a flexible API.","archived":false,"fork":false,"pushed_at":"2017-09-11T15:00:02.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T14:19:19.493Z","etag":null,"topics":["bind","livescript","lodash","underscorejs","utility"],"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/sourcevault.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-17T15:51:46.000Z","updated_at":"2023-12-05T07:04:40.000Z","dependencies_parsed_at":"2022-08-22T22:20:26.959Z","dependency_job_id":null,"html_url":"https://github.com/sourcevault/bindall","commit_stats":null,"previous_names":["badhands/bindall","importvault/bindall"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sourcevault/bindall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fbindall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fbindall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fbindall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fbindall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcevault","download_url":"https://codeload.github.com/sourcevault/bindall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fbindall/sbom","scorecard":{"id":222898,"data":{"date":"2025-08-11","repo":{"name":"github.com/sourcevault/bindall","commit":"3babcd6918d4042cbac9ad7e5cd985cde82a970a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T03:00:21.650Z","repository_id":57118438,"created_at":"2025-08-17T03:00:21.650Z","updated_at":"2025-08-17T03:00:21.650Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","livescript","lodash","underscorejs","utility"],"created_at":"2026-01-21T12:07:51.583Z","updated_at":"2026-01-21T12:07:52.250Z","avatar_url":"https://github.com/sourcevault.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/sourcevault/bindall.svg?branch=master)](https://travis-ci.org/sourcevault/bindall)\r\n\r\n# bindall ( ob , fns  , options )\r\n\r\n#### API\r\n- `ob` - Object to bind methods to.\r\n- `fns` - is an object whose values get fixed bound to `ob`\r\n\r\n*optional*\r\n\r\n- `options`\r\n\r\n  - `select` - Array of string providing names of functions attached to *fns* to bind - in case when binding needs to be done selectively.\r\n\r\n  - `addto` - object to bind the newly created bound methods to. Using this option means `fns` object is **not** mutated and the original methods attached to `fns` is kept in place. \r\n\r\n  - `s` - same as `select`\r\n\r\n  - `a` - same as `addto`\r\n\r\n\r\n\r\n\r\n#### Install\r\n\r\n```\r\nnpm install @sourcevault/bindall\r\n```\r\n\r\n#### Internals\r\n\r\n- [reassign](https://github.com/sourcevault/bindall/blob/7e6208f6157b19a43133822233ff65aee130e274/main.ls#L1) ```.this``` to fixed object for selected functions\r\n\r\n- [mutates](https://github.com/sourcevault/bindall/blob/7e6208f6157b19a43133822233ff65aee130e274/main.ls#L11) `fns` that holds the functions (**default** behavior) . To prevent mutation use the `addto` option.\r\n\r\n- Other implementation ( [lodash](http://devdocs.io/lodash~4/index#bindall), [underscore](http://underscorejs.org/#bindall) ) of `bindall` lack options to control **what** `fns` is bound *to*. Also cannot prevent mutation when needed.\r\n\r\n\r\n\r\n#### Examples\r\n\r\n|[view in beautiful livescript](https://github.com/sourcevault/bindall/tree/livescript) |\r\n| --- |\r\n\r\n- . . binding all functions that exists in `fns` object\r\n\r\n\r\n```javascript\r\n\r\nbindall = require (\"@sourcevault/bindall\")\r\n\r\nlog = function()\r\n{\r\n  console.log (this);\r\n}\r\n\r\n// purpose of this excercise is we want access to ob.fuel\r\n\r\nob =\r\n{\r\n  fuel:\"coffee\",\r\n  fns:\r\n  {\r\n    foo:log\r\n  }\r\n}\r\n\r\nob.fns.foo() // { foo: [Function: log] } // cannot access ob.fuel  :(\r\n\r\nbindall(ob,ob.fns) // [WARNING] → will mutate ob.fns\r\n\r\nob.fns.foo() \r\n\r\n// { fuel: 'coffee', fns: { foo: [Function] } } // can access .fuel now :)\r\n\r\n```\r\n- . . for applying to a subset number of functions in `fns` object\r\n\r\n```javascript\r\nob = \r\n{\r\n  fuel:\"coffee\",\r\n  fns:\r\n  {\r\n    foo:log,\r\n    bar:log\r\n  }\r\n}\r\n\r\n// ↓ only ob.fns.bar is bound due to using select option ↓\r\n\r\nbindall(ob,ob.fns,(select:[\"bar\"]))\r\n\r\nob.fns.bar()\r\n\r\n// { fuel: 'coffee', fns: { foo: [Function: log] , bar: [Function] } }\r\n\r\n// ↓ foo is not bound as expected ↓\r\n\r\nob.fns.foo() // {fns: { foo: [Function: log] , bar: [Function] }}\r\n\r\n\r\n```\r\n\r\n* .. to prevent **mutating** original object `fns`\r\n\r\n```javascript\r\nob = \r\n{\r\n  fuel:\"coffee\",\r\n  fns:{\r\n    foo:log,\r\n    bar:log\r\n  }\r\n}\r\n\r\nboundfns = bindall(ob , ob.fns , ( select:[\"bar\"], addto:{} ))\r\n\r\n// ↓ boundfns contains the newly minted bound fns ↓\r\n\r\nboundfns.bar() // { fuel: 'coffee', fns: { log: [Function] , bar: [Function] }}\r\n\r\n// ↓ original object unchanged ↓\r\n\r\nob.fns.bar()\r\n\r\n// {fns: { foo: [Function: log], bar: [Function: log] } }\r\n\r\n```\r\n\r\n**Notes on Immutability**\r\n\r\n*If a tree falls in a forest and no one is around to hear it, does it make a sound ?*\r\n\r\nPassing an `{}` (empty) object to the `addto` option makes bindall immutable - in the sense that `{}` (empty) object is mutated and the original object from which the methods were extracted is untouched. \r\n\r\nThis is useful . .\r\n- . . if the object providing the methods is external.\r\n\r\n- . . when we need to add our bound functions to an independent object of our choosing.\r\n\r\nbindall that mutate `fns` is dangerous and should be used with caution. The main usecase for mutating `fns` is within the enclave of where it was created.\r\n\r\n\r\n\r\n### Updates and API change\r\n\r\n- `0.3.0` added `s` and `a` for `select` and `addto` respectively for power users\r\n\r\n- `0.2.0` changed `selected` to `option` to expand functionality. Third argument is an object instead of an array and the previous functionality of `selected` is now passed as value to `select` key in `option`. `addto` allows control of what object to attach thee newly created fuctions to.\r\n\r\n- `0.1.0` [readme](https://github.com/sourcevault/bindall/tree/0.1.0)\r\n\r\n## License\r\n \r\nCode and document released under MIT Licence, see [LICENSE](https://github.com/sourcevault/bindall/blob/master/LICENCE) for details.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcevault%2Fbindall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcevault%2Fbindall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcevault%2Fbindall/lists"}