32.1 GB
673,093 files
Updated 5 months ago
Name
Size
test
.github
tsconfig.json116 Bytes
xet
require.mjs127 Bytes
xet
package.json2.25 kB
xet
legacy.js380 Bytes
xet
index.mjs124 Bytes
xet
index.js241 Bytes
xet
index.d.ts448 Bytes
xet
index.d.mts73 Bytes
xet
README.md1.85 kB
xet
LICENSE1.07 kB
xet
CHANGELOG.md946 Bytes
xet
.nycrc139 Bytes
xet
.eslintrc229 Bytes
xet
README.md

async-function Version Badge

github actions coverage License Downloads

npm badge

A function that returns the normally hidden AsyncFunction constructor, when available.

Getting started

npm install --save async-function

Usage/Examples

const assert = require('assert');
const AsyncFunction = require('async-function')();

const fn = new AsyncFunction('return 1');

assert.equal(fn.toString(), 'async function anonymous(\n) {\nreturn 1\n}');

fn().then(x => {
    assert.equal(x, 1);
});

Tests

Clone the repo, npm install, and run npm test

Total size
32.1 GB
Files
673,093
Last updated
Mar 19
Pre-warmed CDN
US EU US EU

Contributors