Options
All
  • Public
  • Public/Protected
  • All
Menu

An object for searching an NPM registry.

Searches the NPM registry via web API: https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md

Hierarchy

  • Searcher

Index

Constructors

constructor

  • new Searcher(repoUri?: string, cdnUri?: string, enableCdn?: boolean): Searcher
  • Create a Searcher object.

    Parameters

    • Optional repoUri: string

      The URI of the NPM registry to use.

    • Optional cdnUri: string

      The URI of the CDN to use for fetching full package data.

    • Optional enableCdn: boolean

    Returns Searcher

Properties

cdnUri

cdnUri: string

The URI of the CDN to use for fetching full package data.

enableCdn

enableCdn: boolean

Whether to use the CDN for fetching full package data. Otherwise, the NPM registry is used.

repoUri

repoUri: string

The URI of the NPM registry to use.

Methods

fetchPackageData

  • fetchPackageData(name: string, version: string): Promise<IJupyterLabPackageData>
  • Fetch package.json of a package

    Parameters

    • name: string

      The package name.

    • version: string

      The version of the package to fetch.

    Returns Promise<IJupyterLabPackageData>

searchExtensions

  • searchExtensions(query: string, page?: number, pageination?: number): Promise<ISearchResult>
  • Search for a jupyterlab extension.

    Parameters

    • query: string

      The query to send. keywords:"jupyterlab-extension" will be appended to the query.

    • Optional page: number

      The page of results to fetch.

    • Optional pageination: number

      The pagination size to use. See registry API documentation for acceptable values.

    Returns Promise<ISearchResult>

Generated using TypeDoc