Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

make-async-function

ljharb10.2kMIT1.0.0TypeScript support: definitely-typed

Function that returns an arbitrary async function, or undefined if async function syntax is unsupported.

async function, async, function, ES2017, ES8, ES7, ES6, promise, await

readme

make-async-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

Function that returns an arbitrary async function, or undefined if async function syntax is unsupported.

Example

var maybeAsyncFunction = require('make-async-function')();
if (maybeAsyncFunction) {
    assert(typeof maybeAsyncFunction === 'function');
} else {
    assert(typeof maybeAsyncFunction === 'undefined');
}

var asyncFunctions = require('make-async-function').list();
assert(asyncFunctions.every(function (fn) { return typeof fn === 'function'; }));

Tests

Simply clone the repo, npm install, and run npm test

changelog

1.0.0 / 2017-09-05

  • Initial release