zlwu dd667101ef first commit 1 년 전
..
.github dd667101ef first commit 1 년 전
test dd667101ef first commit 1 년 전
.eslintrc dd667101ef first commit 1 년 전
.nycrc dd667101ef first commit 1 년 전
CHANGELOG.md dd667101ef first commit 1 년 전
LICENSE dd667101ef first commit 1 년 전
README.md dd667101ef first commit 1 년 전
index.d.mts dd667101ef first commit 1 년 전
index.d.ts dd667101ef first commit 1 년 전
index.js dd667101ef first commit 1 년 전
index.mjs dd667101ef first commit 1 년 전
legacy.js dd667101ef first commit 1 년 전
package.json dd667101ef first commit 1 년 전
require.mjs dd667101ef first commit 1 년 전
tsconfig.json dd667101ef first commit 1 년 전

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