# bind-it

> convert between data-first/last and ::

Latest version **1.0.1** (published 2015-08-03) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-08-03 |
| First published | 2015-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Stoeffel |
| Maintainers | schtoeffel |
| Keywords | ::, bind, es2016 |

## Links

- npm: https://www.npmjs.com/package/bind-it
- Repository: https://github.com/stoeffel/bind-it
- Homepage: https://github.com/stoeffel/bind-it#readme
- Issues: https://github.com/stoeffel/bind-it/issues
- npm.io page: https://npm.io/package/bind-it

## Recent versions

- 1.0.1 (latest) — 2015-08-03
- 1.0.0 — 2015-08-03

## README

# bind-it [![Build Status](https://travis-ci.org/stoeffel/bind-it.svg?branch=master)](https://travis-ci.org/stoeffel/bind-it)

> convert between data-first/last and ::

This is a converter function to make a data-first and data-last function working with [function-bind-operator](http://babeljs.io/blog/2015/05/14/function-bind/)


## Install

```
$ npm install --save bind-it
```


## Usage

```js
import { bindFirst, bindLast } from 'bind-it';

const data = { id: 1, name: 'foo' };

const hasPropFirst = (data, prop) => !!data[prop];
const hasThisFirst = hasPropFirst::bindFirst()


assert.strictEqual(data::hasThisFirst('name'), true);
assert.strictEqual(data::hasThisFirst('nope'), false);


const hasPropLast = (prop, data) => !!data[prop];
const hasThisLast = hasPropLast::bindLast()

assert.strictEqual(data::hasThisLast('name'), true);
assert.strictEqual(data::hasThisLast('nope'), false);
```

`::` huh?
----

If you’re wondering what the `::` thing means, you’d better read this excellent [overview](https://github.com/jussi-kalliokoski/trine/blob/5b735cbfb6b28ae94bac0446d9ecd5ce51fb149b/README.md#why) by [@jussi-kalliokoski](https://github.com/jussi-kalliokoski) or have a look at the [function bind syntax proposal](https://github.com/zenparsing/es-function-bind).



## License

MIT © [Stoeffel](http://stoeffel.github.io)

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