# quick-bind

> A shorthand for Function.prototype.bind() to allow binding without changing the context.

Latest version **0.0.2** (published 2017-02-15) · 0 weekly downloads

## Install

```sh
npm install quick-bind
pnpm add quick-bind
yarn add quick-bind
bun add quick-bind
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-02-15 |
| First published | 2017-02-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Josh Cole |
| Maintainers | saikojosh |

## Links

- npm: https://www.npmjs.com/package/quick-bind
- npm.io page: https://npm.io/package/quick-bind

## Recent versions

- 0.0.2 (latest) — 2017-02-15
- 0.0.1 — 2017-02-07

## README

# Quick-Bind
A shorthand for Function.prototype.bind() to allow binding without changing the context.

## Usage
Add this line as close to the top of your entry file as possible:

```javascript
require('quick-bind').modifyFunctionPrototype();
```

You can then prefix parameters to functions without needing to specify the context as the first parameter:

```javascript
function threeParameterFunc (a, b, c) {
	console.log(a, b, c);
}

const myFunc = threeParameterFunc._bind('param1', 'param2');
myFunc('param3');  // Outputs "param1 param2 param3"
```

## Don't like ._bind() - then change it
If you'd like to change the name of the function from ._bind() to something else just pass it to "modifyFunctionPrototype()" like:

```javascript
require('quick-bind').modifyFunctionPrototype('args');

const myFunc = threeParameterFunc.args('param1', 'param2');
myFunc('param3');
```
You cannot change the function name to any properties that are already set on Function.prototype. This prevents you from inadvertently overwriting any native methods.

---
_Source: https://npm.io/package/quick-bind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
