学习?学个屁 06c63c15cc 初始化提交 2 mesi fa
..
.github 06c63c15cc 初始化提交 2 mesi fa
test 06c63c15cc 初始化提交 2 mesi fa
.eslintrc 06c63c15cc 初始化提交 2 mesi fa
.nycrc 06c63c15cc 初始化提交 2 mesi fa
CHANGELOG.md 06c63c15cc 初始化提交 2 mesi fa
LICENSE 06c63c15cc 初始化提交 2 mesi fa
README.md 06c63c15cc 初始化提交 2 mesi fa
index.d.mts 06c63c15cc 初始化提交 2 mesi fa
index.d.ts 06c63c15cc 初始化提交 2 mesi fa
index.js 06c63c15cc 初始化提交 2 mesi fa
index.mjs 06c63c15cc 初始化提交 2 mesi fa
legacy.js 06c63c15cc 初始化提交 2 mesi fa
package.json 06c63c15cc 初始化提交 2 mesi fa
require.mjs 06c63c15cc 初始化提交 2 mesi fa
tsconfig.json 06c63c15cc 初始化提交 2 mesi fa

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