# bound-native-methods

> Bound native virtual methods to be used together with ES7 :: bind operator.

Latest version **0.1.6** (published 2015-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install bound-native-methods
pnpm add bound-native-methods
yarn add bound-native-methods
bun add bound-native-methods
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2015-06-05 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | G. Kay Lee |
| Maintainers | gsklee |
| Keywords | virtual method, method extraction, function bind, bind operator, bind, es6, es7, babel |

## Links

- npm: https://www.npmjs.com/package/bound-native-methods
- Repository: https://github.com/gsklee/bound-native-methods
- Homepage: https://github.com/gsklee/bound-native-methods#readme
- Issues: https://github.com/gsklee/bound-native-methods/issues
- npm.io page: https://npm.io/package/bound-native-methods

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2015-06-05
- 0.1.5 — 2015-06-05
- 0.1.4 — 2015-05-24
- 0.1.3 — 2015-05-24
- 0.1.2 — 2015-05-24
- 0.1.1 — 2015-05-24
- 0.1.0 — 2015-05-24
- 0.0.5 — 2015-05-22
- 0.0.4 — 2015-05-22
- 0.0.3 — 2015-05-22
- 0.0.2 — 2015-05-22
- 0.0.1 — 2015-05-22

## README

Bound Native Methods
====================

This library exports a collection of bound native [**virtual methods**](http://babeljs.io/blog/2015/05/14/function-bind/#virtual-methods) - static methods of JavaScript standard built-in objects in their bound form - so that they can be used together with the [proposed **bind operator**](https://github.com/zenparsing/es-function-bind).

Install
-------

```bash
$ npm install bound-native-methods
```

Usage
-----

```javascript
import * from 'bound-native-methods';

// Or, be more specific and cut down the build size: //

import {assign, keys} from 'bound-native-methods/object';
```

```javascript
0::isInteger();
// true
```

```javascript
[3, 6, 9]::max()::is(9);
// true
```

```javascript
{'2015-06-01T15:30:00.000Z': 300}::assign({'2015-07-01T15:30:00.000Z': 42})
                                 ::keys()
                                  .map(x => x::toUnixOffset())
                                 ::toJSON();
// [1433172600000,1435764600000]
```

API
---

Most static methods have been exported as is, but a few have been renamed or excluded to better fit the context:

#### Object

| Native Form | Bound Form |
| ----------- | ---------- |
| Object.getPrototypeOf() | ::getPrototype() |
| Object.setPrototypeOf() | ::setPrototype() |

#### Symbol

| Native Form | Bound Form |
| ----------- | ---------- |
| Symbol.for()    | ::toSymbol() <sup>[1]</sup> |
| Symbol.keyFor() | ::key()                     |

#### Number

| Native Form | Bound Form |
| ----------- | ---------- |
| Number.parseFloat() | ::toFloat() <sup>[1]</sup> |
| Number.parseInt()   | ::toInt() <sup>[1]</sup>   |

#### Math

| Native Form | Bound Form |
| ----------- | ---------- |
| Math.pow() <sup>[2]</sup> | × |
| Math.random()             | × |

#### Date

| Native Form | Bound Form |
| ----------- | ---------- |
| Date.UTC()   | ×                               |
| Date.now()   | ×                               |
| Date.parse() | ::toUnixOffset() <sup>[1]</sup> |

#### Array

| Native Form | Bound Form |
| ----------- | ---------- |
| Array.from() | × |
| Array.of()   | × |

#### ArrayBuffer

#### JSON

| Native Form | Bound Form |
| ----------- | ---------- |
| JSON.parse()     | ::toObject() <sup>[1]</sup> |
| JSON.stringify() | ::toJSON() <sup>[1]</sup>   |

> ###### Notes:
> 1. Bound methods whose names start with "to..." are to be applied to strings (with the exception of `::toJSON()` which can be applied to a variety of data types)
> 2. Please use the exponentiation operator `**` instead

License
-------

MIT © G. Kay Lee

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