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

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