todoApp/node_modules/async-function
Fernando Escobar Robles 50469288e1 version 1.0 2025-03-26 08:18:28 -06:00
..
.github version 1.0 2025-03-26 08:18:28 -06:00
test version 1.0 2025-03-26 08:18:28 -06:00
.eslintrc version 1.0 2025-03-26 08:18:28 -06:00
.nycrc version 1.0 2025-03-26 08:18:28 -06:00
CHANGELOG.md version 1.0 2025-03-26 08:18:28 -06:00
LICENSE version 1.0 2025-03-26 08:18:28 -06:00
README.md version 1.0 2025-03-26 08:18:28 -06:00
index.d.mts version 1.0 2025-03-26 08:18:28 -06:00
index.d.ts version 1.0 2025-03-26 08:18:28 -06:00
index.js version 1.0 2025-03-26 08:18:28 -06:00
index.mjs version 1.0 2025-03-26 08:18:28 -06:00
legacy.js version 1.0 2025-03-26 08:18:28 -06:00
package.json version 1.0 2025-03-26 08:18:28 -06:00
require.mjs version 1.0 2025-03-26 08:18:28 -06:00
tsconfig.json version 1.0 2025-03-26 08:18:28 -06:00

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