coresyncreact1/node_modules/async-function
2025-08-05 00:16:33 +03:00
..
.github C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
test C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
.eslintrc C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
.nycrc C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
CHANGELOG.md C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
index.d.mts C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
index.d.ts C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
index.js C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
index.mjs C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
legacy.js C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
LICENSE C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
package.json C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
README.md C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
require.mjs C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03:00
tsconfig.json C:\Users\MSI\Desktop\frontend\coresync-react 2025-08-05 00:16:33 +03: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