Socket
Socket
Sign inDemoInstall

asynccbn

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

asynccbn


Version published
Weekly downloads
2
Maintainers
1
Install size
13.8 MB
Created
Weekly downloads
 

Readme

Source

asynccbn

Babel Plugin to transpile EcmaScript7 async function transpiled into callbacks.

Build Status Dependencies Coverage Status

NPM

still working, carefull in production enviroments

Why

Promises and generators need more memory and are slower then callbacks.

install

npm install asynccbn

usage

Use it as a babeljs plugin

sample 1: defining an async function

input:

  async function divide(a,b)
  {                         
    return a/b;
  }            

output:

  function divide(a, b, callback) {
    callback(null, a / b);
  }
  

sample 2: invoking async function

input:

  async function fn() { 
    return await divide(8,2) + await divide(10,2);
  }

output:

 divide(8, 2, function(err$, res$1) {
   if (err$) return callback(err$);
   divide(10, 2, function(err$, res$2) {
     if (err$) return callback(err$);
     callback(null, res$1+res$2);
   });
 });  

Keywords

FAQs

Last updated on 09 Jul 2015

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc