Options
All
  • Public
  • Public/Protected
  • All
Menu

Package plugin-npm

@yarnpkg/plugin-npm

This plugin adds support for downloading packages from the npm registry.

Install

This plugin is included by default in Yarn.

Type aliases

AuthOptions

AuthOptions: object

Type declaration

Options

Options: httpUtils.Options & AuthOptions & RegistryOptions

RegistryOptions

RegistryOptions: object | object

Variables

Const NODE_GYP_IDENT

NODE_GYP_IDENT: Ident = structUtils.makeIdent(null, `node-gyp`)

Const NODE_GYP_MATCH

NODE_GYP_MATCH: RegExp = /\b(node-gyp|prebuild-install)\b/

Const PROTOCOL

PROTOCOL: "npm:" = `npm:`

Functions

askForOtp

  • askForOtp(): Promise<string>

get

  • get(path: string, __namedParameters: object): Promise<any>

getAuthConfiguration

  • getAuthConfiguration(registry: string, __namedParameters: object): MapLike

getAuthenticationHeader

  • getAuthenticationHeader(registry: string, __namedParameters: object): null | string

getDefaultRegistry

  • getDefaultRegistry(__namedParameters: object): string

getIdentUrl

  • getIdentUrl(ident: Ident): string

getOtpHeaders

  • getOtpHeaders(otp: string): object

getPublishRegistry

  • getPublishRegistry(manifest: Manifest, __namedParameters: object): string

getRegistryConfiguration

  • getRegistryConfiguration(registry: string, __namedParameters: object): MapLike | null

getScopeConfiguration

  • getScopeConfiguration(scope: string | null, __namedParameters: object): MapLike | null

getScopeRegistry

  • getScopeRegistry(scope: string | null, __namedParameters: object): string

isOtpError

  • isOtpError(error: any): any

normalizeRegistry

  • normalizeRegistry(registry: string): string

put

  • put(path: string, body: httpUtils.Body, __namedParameters: object): Promise<Buffer>

shouldAuthenticate

whoami

  • whoami(registry: string, headers: object | undefined, __namedParameters: object): Promise<any>

Object literals

Const authSettings

authSettings: object

npmAlwaysAuth

npmAlwaysAuth: object

default

default: boolean = false

description

description: string = `URL of the selected npm registry (note: npm enterprise isn't supported)`

type

type: BOOLEAN = SettingsType.BOOLEAN

npmAuthIdent

npmAuthIdent: object

default

default: null = null

description

description: string = `Authentication identity for the npm registry (_auth in npm and yarn v1)`

type

type: SECRET = SettingsType.SECRET

npmAuthToken

npmAuthToken: object

default

default: null = null

description

description: string = `Authentication token for the npm registry (_authToken in npm and yarn v1)`

type

type: SECRET = SettingsType.SECRET

Const plugin

plugin: object

fetchers

fetchers: (NpmSemverFetcher | NpmHttpFetcher)[] = [NpmHttpFetcher,NpmSemverFetcher,]

resolvers

resolvers: (NpmRemapResolver | NpmSemverResolver | NpmTagResolver)[] = [NpmRemapResolver,NpmSemverResolver,NpmTagResolver,]

configuration

configuration: object

npmRegistries

npmRegistries: object

description

description: string = `Settings per registry`

normalizeKeys

normalizeKeys: normalizeRegistry = npmConfigUtils.normalizeRegistry

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = ``

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

npmScopes

npmScopes: object

description

description: string = `Settings per package scope`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = ``

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

Const registrySettings

registrySettings: object

npmPublishRegistry

npmPublishRegistry: object

default

default: null = null

description

description: string = `Registry to push packages to`

type

type: STRING = SettingsType.STRING

npmRegistryServer

npmRegistryServer: object

default

default: string = `https://registry.yarnpkg.com`

description

description: string = `URL of the selected npm registry (note: npm enterprise isn't supported)`

type

type: STRING = SettingsType.STRING

Generated using TypeDoc