Options
All
  • Public
  • Public/Protected
  • All
Menu

@dekkai/env - v1.0.1

Index

Functions

isBrowser

  • isBrowser(): boolean
  • Checks if the current environment is a browser. NOTE: The current implementation assumes that if the environment is not NodeJS or Deno then it must be a browser.

    Returns boolean

isDeno

  • isDeno(): boolean
  • Checks if the current environment is Deno.

    Returns boolean

isNodeJS

  • isNodeJS(): boolean
  • Checks if the current environment is NodeJS.

    Returns boolean

loadModule

  • loadModule(mod: string | URL): Promise<any>
  • Detects the environment and loads a module using either require or import.

    Parameters

    • mod: string | URL

      The name or path to the module to load.

    Returns Promise<any>

supportsDynamicImport

  • supportsDynamicImport(): boolean
  • Returns a boolean that defines if the current environment supports dynamic imports.

    Returns boolean

Generated using TypeDoc