call-bind (1.0.8)

Published 2026-02-24 13:53:47 +00:00 by atheaadmin

Installation

registry=
npm install call-bind@1.0.8
"call-bind": "1.0.8"

About this package

call-bind Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Robustly .call.bind() a function.

Getting started

npm install --save call-bind

Usage/Examples

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');

delete Function.prototype.call;
delete Function.prototype.bind;

fBound(1, 2, 3);

assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);

Tests

Clone the repo, npm install, and run npm test

Dependencies

Dependencies

ID Version
call-bind-apply-helpers ^1.0.0
es-define-property ^1.0.0
get-intrinsic ^1.2.4
set-function-length ^1.2.2

Development Dependencies

ID Version
@ljharb/eslint-config ^21.1.1
auto-changelog ^2.5.0
encoding ^0.1.13
es-value-fixtures ^1.5.0
eslint =8.8.0
evalmd ^0.0.19
for-each ^0.3.3
has-strict-mode ^1.0.1
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
object-inspect ^1.13.3
safe-publish-latest ^2.0.0
tape ^5.9.0

Keywords

javascript ecmascript es js callbind callbound call bind bound call-bind call-bound function es-abstract
Details
npm
2026-02-24 13:53:47 +00:00
1
Jordan Harband
MIT
latest
7.6 KiB
Assets (1)
Versions (1) View all
1.0.8 2026-02-24