mirror-rhinstaller-node-cache/async-function
2026-09-28 07:03:59 +00:00
..
test 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
.eslintrc 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
.nycrc 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
CHANGELOG.md 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
index.d.mts 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
index.d.ts 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
index.js 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
index.mjs 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
legacy.js 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
LICENSE 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
package.json 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
README.md 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
require.mjs 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00
tsconfig.json 599101c2959ea504d8e9185b484074f77867d03949caa8f1d6b61909f57eba72 package.json 2026-09-28 07:03:59 +00:00

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