call-bind
npmv1.0.9Robustly `.call.bind()` a function
Safe to adopt
Yes — call-bind scores well across adoption, maintenance, weight, supply chain, and licensing. 80.7M downloads per week and 5 known dependents. Last published 153 days ago. 2 releases in the last 2 years.
- AAdoption: grade A, Excellent.
80.7M downloads per week and 5 known dependents.
- BMaintenance: grade B, Good.
Last published 153 days ago. 2 releases in the last 2 years.
- BWeight: grade B, Good.
Pulls in 14 transitive packages, about 230 KB installed (at least — some of the tree is still being crawled).
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding call-bind to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Licenses in the dependency tree
Every license you inherit by installing call-bind, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >= 0.4
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the call-bind README.
const assert = require('assert');
const callBind = require('call-bind');
const callBound = require('call-bind/callBound');
function f(a, b) {
assert.equal(this, 1);
assert.equal(a, 2);
assert.equal(b, 3);
assert.equal(arguments.length, 2);
}
const fBound = callBind(f);
const slice = callBound('Array.prototype.slice');call-bind vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| call-bindthis page | 80.7M | 5 | MIT | 5 months ago |
| call-bound | 0 | 7 | MIT | 1 day ago |
| get-intrinsic | 0 | 8 | MIT | 1 day ago |
| set-function-length | 0 | 1 | MIT | 1 day ago |
| eslint | 138.4M | 279 | MIT | 1 day ago |
| es-define-property | 131.3M | 4 | MIT | 1 day ago |
Dependencies
Declared by call-bind v1.0.9. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (4)
Dev (14)
Used by
Popular packages that depend on call-bind.
ES2015-compliant shim for Object.is - differentiates between -0 and +0
node's assert.deepEqual algorithm
ES6 spec-compliant RegExp.prototype.flags shim.
Get an iterator for any JS language value. Works robustly across all environments, all versions.
Set a function's length property
Relationship graph
Dependencies (left) and dependents (right) of call-bind.
Frequently installed together
An AST-based pattern checker for JavaScript.
string representations of objects in node and the browser
Get and robustly cache all JS language-level intrinsics at first require time
Array#isArray for older browsers
Is this an arguments object? It's a harder question than you think.
Does this JS environment support the `name` property on functions?
A simple cache for a few of the JS Error constructors.
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
Firefox 17-26 iterators throw a StopIteration object to indicate "done". This normalizes it.
ES2015-compliant shim for Object.is - differentiates between -0 and +0
Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Release history
2 releases in the last two years, typically about 70 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.0.9latest | 5 months ago | 24 KB | MIT |
| 1.0.8 | 1 year ago | 22 KB | MIT |
| 1.0.7 | 2 years ago | 22 KB | MIT |
| 1.0.6 | 2 years ago | 21 KB | MIT |
| 1.0.5 | 2 years ago | 21 KB | MIT |
| 1.0.4 | 2 years ago | 20 KB | MIT |
| 1.0.3 | 2 years ago | 828 KB | MIT |
| 1.0.2 | 5 years ago | 14 KB | MIT |
| 1.0.1 | 5 years ago | 14 KB | MIT |
| 1.0.0 | 5 years ago | 12 KB | MIT |
Overview
call-bind is an npm package that robustly `.call.bind()` a function. It is extremely widely used, with about 80.7M downloads per week and 5 known dependents in the graph. The latest version is 1.0.9, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need robustly `.call.bind()` a function and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (80.7M weekly downloads).
- Clear open-source license (MIT).
Cons
- Large dependency tree (18 direct dependencies) increases install size and audit surface.
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use call-bind?
Yes — call-bind scores well across adoption, maintenance, weight, supply chain, and licensing. 80.7M downloads per week and 5 known dependents. Last published 153 days ago. 2 releases in the last 2 years.
How do I install call-bind?
Run `npm install call-bind` to add call-bind to your npm project.
How many dependencies does call-bind have?
call-bind declares 18 direct dependencies and pulls in 14 packages in total once its runtime tree is resolved totalling about 230 KB on disk.
What license is call-bind released under?
call-bind is distributed under the MIT license.
How popular is call-bind?
call-bind has approximately 80,663,839 downloads per week and 5 known dependent packages.
Is call-bind still maintained?
The most recent release of call-bind (v1.0.9) was published 5 months ago.
Does call-bind run install scripts?
No. call-bind does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.