make-async-function
v1.0.0
Published
Function that returns an arbitrary `async function`, or undefined if `async function` syntax is unsupported.
Downloads
6,087
Maintainers
Readme
make-async-function
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