Skip to content
Function that returns an arbitrary `async function`, or undefined if `async function` syntax is unsupported.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
test
.eslintrc Implementation. Sep 5, 2017
.gitignore
.npmrc
.travis.yml
CHANGELOG.md
LICENSE
README.md
index.js
package.json [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-pu… Jan 12, 2020

README.md

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

You can’t perform that action at this time.