htc 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
..
.github 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
test 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
.eslintrc 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
.nycrc 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
CHANGELOG.md 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
LICENSE 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
README.md 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
index.d.mts 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
index.d.ts 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
index.js 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
index.mjs 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
legacy.js 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
package.json 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
require.mjs 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano
tsconfig.json 7ca38fdcbb 善行少年PC端首次提交(基础版) hai 1 ano

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