Skip to content

ljharb/make-async-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

make-async-function Version Badge

github actions coverage 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

About

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

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks