@types/browser-resolve

  • Version 2.0.4
  • Published
  • 6.96 kB
  • 1 dependency
  • MIT license

Install

npm i @types/browser-resolve
yarn add @types/browser-resolve
pnpm add @types/browser-resolve

Overview

TypeScript definitions for browser-resolve

Index

Functions

function resolve

resolve: typeof resolve;
  • Resolve a module path and call cb(err, path)

    Parameter id

    Identifier to resolve

    Parameter callback

  • Resolve a module path and call cb(err, path)

    Parameter id

    Identifier to resolve

    Parameter options

    Options to use for resolving, optional.

    Parameter callback

function sync

sync: (id: string, opts?: SyncOpts) => string;
  • Returns a module path

    Parameter id

    Identifier to resolve

    Parameter options

    Options to use for resolving.

Interfaces

interface Opts

interface Opts {}

    property basedir

    basedir?: string | undefined;
    • directory to begin resolving from

    property browser

    browser?: string | undefined;
    • the 'browser' property to use from package.json 'browser'

    property filename

    filename?: string | undefined;
    • the calling filename where the require() call originated (in the source)

    property modules

    modules?: { [id: string]: string } | undefined;
    • modules object with id to path mappings to consult before doing manual resolution (use to provide core modules)

    property packageFilter

    packageFilter?: ((info: any, pkgdir: string) => any) | undefined;
    • transform the parsed package.json contents before looking at the main field

    property paths

    paths?: string[] | undefined;
    • require.paths array to use if nothing is found on the normal node_modules recursive walk

    Type Aliases

    type AsyncOpts

    type AsyncOpts = resv.AsyncOpts & Opts;

      type Callback

      type Callback = (err: Error | null, resolved?: string) => void;
      • Callback invoked when resolving asynchronously

        Parameter error

        Parameter resolved

        Absolute path to resolved identifier

      type SyncOpts

      type SyncOpts = resv.SyncOpts & Opts;

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (0)

        No dev dependencies.

        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/@types/browser-resolve.

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