async-function
A function that returns the normally hidden `AsyncFunction` constructor
Last updated a year ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install async-function 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (a year ago)

2 Versions

  • 1.0.0                                ...           a year ago
  • 0.1.0                                ...           10 years ago
Maintainers (2)
Downloads
Today 0
This Week 36
This Month 54
Last Day 2
Last Week 26
Last Month 70
Dependencies (0)
None
Dev Dependencies (16)

Copyright 2013 - present © cnpmjs.org | Home |