# async-nmbr

> ### Very useful JavaScript Number operator overloading for asynchronous http math operations

Latest version **1.1.0** (published 2020-01-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install async-nmbr
pnpm add async-nmbr
yarn add async-nmbr
bun add async-nmbr
```

## 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.1.0 |
| Published | 2020-01-25 |
| First published | 2019-12-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nikolai Kolodziej |
| Maintainers | n-kolodziej |

## Links

- npm: https://www.npmjs.com/package/async-nmbr
- Repository: https://github.com/n-kolodziej/async-nmbr
- Homepage: https://nmbr.dev/
- Issues: https://github.com/n-kolodziej/async-nmbr/issues
- npm.io page: https://npm.io/package/async-nmbr

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Recent versions

- 1.1.0 (latest) — 2020-01-25
- 1.0.1 — 2019-12-09
- 1.0.0 — 2019-12-06

## README

## async-nmbr

### Very useful JavaScript Number operator overloading for asynchronous http math operations

#### Getting Started

1. `npm install --save async-nmbr`
1. `npm install --save-dev @babel/core @babel/cli babel-plugin-overload babel-template`
1. Create a file called `.babelrc` in your projects root directory
1. Place the following content inside: `{ "plugins": ["overload"] }`
1. Find out [how you can build/compile your project](https://babeljs.io/docs/en/babel-cli#usage), e.g.: `npx babel src -d lib`

#### Usage

Once the initial setup is completed you'll need to actually overload the operators for the `Number` type.

You can do this by simply requiring this package and passing the `Number` object in every file that you want to use it in, like this:

```javascript
require('async-nmbr')(Number);
```

Now that the operators are overloaded, you can do awesome calculations like:

```javascript
await (1 + 1); // 2
await (100 - 1); // 99
await (2 * 2); // 4
await (Math.PI / 3); // 1.0471975511965976

(Math.PI * 3).then(res => res / 3).then(pi => console.log(pi));
```

Please note: when using this package you'll always have to await your math calculations (isn't that awesome?)

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