make-async-function

make-async-function JS library on GitHub make-async-function JS library on npm Download make-async-function JS library

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

Version 1.0.0 License MIT
make-async-function has no homepage
make-async-function JS library on GitHub
make-async-function JS library on npm
Download make-async-function JS library
Keywords
async functionasyncfunctionES2017ES8ES7ES6promiseawait
INSTALL
Type:
No default JS file set by the package author so the URL is guessed. You can always browse all package files to use another one.

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