Options
All
  • Public
  • Public/Protected
  • All
Menu

External module require-all

This module defines the requireAll function and its options.

The goal of this function is to generate scripts that statically require or import a list of dependencies.

internal

Index

Functions

generateSourceText

  • generateSourceText(specifiers: keyof string[], mode: "esm" | "cjs", suffix?: undefined | string): string
  • Generates the source text to import all the specifiers.

    The imports are wrapped in an IIFE.

    Parameters

    • specifiers: keyof string[]

      Sequence of specifiers to import.

    • mode: "esm" | "cjs"

      "cjs" to use a sequence of require(...), "esm" to use await import(...).

    • Optional suffix: undefined | string

      Raw source text to execute after all the imports are completed.

    Returns string

    Source text for the module body.

requireAll

Generated using TypeDoc