Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-nmbr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-nmbr

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

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

async-nmbr

Very useful JavaScript Number operator overloading for asynchronous http math operations

Getting Started
  1. npm install --save async-nmbr
  2. npm install --save-dev @babel/core @babel/cli babel-plugin-overload babel-template
  3. Create a file called .babelrc in your projects root directory
  4. Place the following content inside: { "plugins": ["overload"] }
  5. Find out how you can build/compile your project, 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:

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

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

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?)

FAQs

Package last updated on 25 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc