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

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