async-function (1.0.0)

Published 2026-02-24 13:53:07 +00:00 by atheaadmin

Installation

registry=
npm install async-function@1.0.0
"async-function": "1.0.0"

About this package

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

Dependencies

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.3
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.3
@types/semver ^6.2.7
@types/tape ^5.8.1
auto-changelog ^2.5.0
eslint =8.8.0
evalmd ^0.0.19
get-proto ^1.0.1
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
safe-publish-latest ^2.0.0
semver ^6.3.1
tape ^5.9.0
typescript next

Keywords

async await function native
Details
npm
2026-02-24 13:53:07 +00:00
0
Jordan Harbamd
MIT
latest
4.3 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-02-24