degenerator

  • Version 3.0.1
  • Published
  • 18.8 kB
  • 4 dependencies
  • MIT license

Install

npm i degenerator
yarn add degenerator
pnpm add degenerator

Overview

Compiles sync functions into async generator functions

Index

Functions

function compile

compile: <R = any, A extends any[] = []>(
code: string,
returnName: string,
names: DegeneratorNames,
options?: CompileOptions
) => (...args: A) => Promise<R>;

    function degenerator

    degenerator: typeof degenerator;
    • Compiles sync JavaScript code into JavaScript with async Functions.

      Parameter code

      JavaScript string to convert

      Parameter names

      Array of function names to add await operators to {String} Converted JavaScript string with async/await injected public

    Interfaces

    interface CompileOptions

    interface CompileOptions extends RunningScriptOptions {}

      property sandbox

      sandbox?: Context;

        Type Aliases

        type DegeneratorName

        type DegeneratorName = string | RegExp;

          type DegeneratorNames

          type DegeneratorNames = DegeneratorName[];

            Package Files (1)

            Dependencies (4)

            Dev Dependencies (17)

            Peer Dependencies (0)

            No peer dependencies.

            Badge

            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/degenerator.

            • Markdown
              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/degenerator)
            • HTML
              <a href="https://www.jsdocs.io/package/degenerator"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>