1.1.0 • Published 6 years ago

es-async v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

*nix build status Windows build status Tests coverage npm version

es-async

ES2017 async functions compiler

Backed by nodent-compiler, compiles async/await syntax into valid ES2016 code.

Installation

$ npm install es-async

CLI usage

Compile JS file using async/await into ES2016 compliant JS file:

npx es-async path-to-es2017-file.js > path-to-es2016-file.js

Programmatical usage

Compile async code directly

const compileAsync = require("es-async");

const es2016Code = compileAsync(es2017Code);

Compile specific file

const compileAsyncFromFile = require("es-async/from-file");

compileFromFile(es2017Filename).then(es2016Code => {
	// Process compiled code
});

Result examples

See online demo. Compilation is handled by preconfigured (to reflect native behavior backed by native promises) nodent-compiler

Tests

$ npm test

Project cross-browser compatibility supported by: