Options
All
  • Public
  • Public/Protected
  • All
Menu

Package yarnpkg-core

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AllDependencies

AllDependencies: "dependencies" | "devDependencies" | "peerDependencies"

AllTransforms

AllTransforms: typeof transforms

BaseSettingsDefinition

BaseSettingsDefinition<T>: object

Type parameters

Type declaration

  • description: string
  • Optional isArray?: undefined | false | true
  • type: T

Body

Body: null | string | Buffer | object

BuildDirective

BuildDirective: [BuildType, string]

CommandContext

CommandContext: object

Type declaration

DescriptorHash

DescriptorHash: string & object

ExecutePackageAccessibleBinaryOptions

ExecutePackageAccessibleBinaryOptions: object

Type declaration

  • cwd: PortablePath
  • Optional nodeArgs?: Array<string>
  • project: Project
  • stderr: Writable
  • stdin: Readable | null
  • stdout: Writable

ExecutePackageScriptOptions

ExecutePackageScriptOptions: object

Type declaration

  • Optional cwd?: PortablePath | undefined
  • project: Project
  • stderr: Writable
  • stdin: Readable | null
  • stdout: Writable

ExecuteWorkspaceAccessibleBinaryOptions

ExecuteWorkspaceAccessibleBinaryOptions: object

Type declaration

  • cwd: PortablePath
  • stderr: Writable
  • stdin: Readable | null
  • stdout: Writable

ExecuteWorkspaceLifecycleScriptOptions

ExecuteWorkspaceLifecycleScriptOptions: object

Type declaration

ExecuteWorkspaceScriptOptions

ExecuteWorkspaceScriptOptions: object

Type declaration

  • Optional cwd?: PortablePath | undefined
  • stderr: Writable
  • stdin: Readable | null
  • stdout: Writable

ExecvpOptions

ExecvpOptions: object

Type declaration

  • cwd: PortablePath
  • Optional encoding?: undefined | string
  • Optional env?: undefined | object
  • Optional strict?: undefined | false | true

FetchFromCacheOptions

FetchFromCacheOptions: object

Type declaration

FetchOptions

FetchOptions: MinimalFetchOptions & object

FetchResult

FetchResult: object

Type declaration

  • Optional checksum?: undefined | string

    The checksum for the fetch result.

  • Optional discardFromLookup?: undefined | false | true

    If true, the package location won't be considered for package lookups (so for example with can use this flag to indicate that the link: protocol should be resolvable, but should never be used to detect the package that owns a path).

  • Optional localPath?: PortablePath | null

    The "true" place where we can find the sources. We use that in order to compute the file: and link: relative paths.

  • packageFs: FakeFS<PortablePath>
  • prefixPath: PortablePath

    The path where the package can be found within the packageFs. This is typically the "node_modules//` path.

  • Optional releaseFs?: undefined | function

    If set, this function will be called once the fetch result isn't needed anymore. Typically used to release the ZipFS memory.

FinalizeInstallStatus

FinalizeInstallStatus: object

Type declaration

FindProjectOptions

FindProjectOptions: object

Type declaration

  • Optional lookup?: ProjectLookup
  • Optional strict?: undefined | false | true
  • Optional usePath?: undefined | false | true
  • Optional useRc?: undefined | false | true

FormatType

FormatType: Type

GetPackageAccessibleBinariesOptions

GetPackageAccessibleBinariesOptions: object

Type declaration

HardDependencies

HardDependencies: "dependencies" | "devDependencies"

HasPackageScriptOption

HasPackageScriptOption: object

Type declaration

Hooks

Hooks: object

Type declaration

  • Optional afterAllInstalled?: undefined | function
  • Optional globalHashGeneration?: undefined | function
  • Optional populateYarnPaths?: undefined | function
  • Optional reduceDependency?: undefined | function
  • Optional registerPackageExtensions?: undefined | function
  • Optional setupScriptEnvironment?: undefined | function
  • Optional validateProject?: undefined | function
  • Optional validateWorkspace?: undefined | function
  • Optional wrapScriptExecution?: undefined | function

IdentHash

IdentHash: string & object

InstallOptions

InstallOptions: object

Type declaration

  • cache: Cache
  • Optional fetcher?: Fetcher
  • Optional immutable?: undefined | false | true
  • Optional lockfileOnly?: undefined | false | true
  • Optional persistProject?: undefined | false | true
  • report: Report
  • Optional resolver?: Resolver

InstallStatus

InstallStatus: object

Type declaration

LightReportOptions

LightReportOptions: object

Type declaration

  • configuration: Configuration
  • stdout: Writable
  • Optional suggestInstall?: undefined | false | true

LinkOptions

LinkOptions: MinimalLinkOptions & object

LocatorHash

LocatorHash: string & object

MapSettingsDefinition

MapSettingsDefinition: BaseSettingsDefinition<MAP> & object

MinimalFetchOptions

MinimalFetchOptions: object

Type declaration

MinimalLinkOptions

MinimalLinkOptions: object

Type declaration

MinimalResolveOptions

MinimalResolveOptions: object

Type declaration

Options

Options: object

Type declaration

  • configuration: Configuration
  • Optional headers?: undefined | object
  • Optional jsonRequest?: undefined | false | true
  • Optional jsonResponse?: undefined | false | true
  • Optional method?: Method

ParseRangeOptions

ParseRangeOptions: object

Type declaration

  • Optional parseSelector?: undefined | false | true
  • Optional requireBindings?: undefined | false | true
  • Optional requireProtocol?: boolean | string
  • Optional requireSource?: undefined | false | true

ParseRangeReturnType

ParseRangeReturnType<Opts>: object & object & object & object

Type parameters

PipevpOptions

PipevpOptions: object

Type declaration

  • cwd: PortablePath
  • Optional end?: EndStrategy
  • Optional env?: undefined | object
  • stderr: Writable
  • stdin: Readable | null
  • stdout: Writable
  • Optional strict?: undefined | false | true

Plugin

Plugin<PluginHooks>: object

Type parameters

  • PluginHooks

Type declaration

PluginConfiguration

PluginConfiguration: object

Type declaration

  • modules: Map<string, any>
  • plugins: Set<string>

ProcessEnvironment

ProcessEnvironment: object

Type declaration

  • [key: string]: string

ProgressDefinition

ProgressDefinition: object

Type declaration

  • progress: number
  • Optional title?: undefined | string

RegistryBlock

RegistryBlock: object

Type declaration

  • Optional enumerators?: undefined | object
  • Optional hits?: undefined | object
  • Optional values?: undefined | object

RegistryFile

RegistryFile: object

Type declaration

  • Optional blocks?: undefined | object
  • Optional lastUpdate?: undefined | number

ResolveOptions

ResolveOptions: MinimalResolveOptions & object

SettingTransforms

SettingTransforms: object

Type declaration

  • getNativePaths: boolean
  • hideSecrets: boolean

SettingsDefinition

SettingsDefinitionNoDefault

SettingsDefinitionNoDefault: MapSettingsDefinition | ShapeSettingsDefinition | Omit<SimpleSettingsDefinition, "default">

ShapeSettingsDefinition

ShapeSettingsDefinition: BaseSettingsDefinition<SHAPE> & object

SimpleSettingsDefinition

SimpleSettingsDefinition: BaseSettingsDefinition<Exclude<SettingsType, SHAPE | MAP>> & object

Source

Source<T>: T extends keyof AllTransforms ? Parameters<AllTransforms[T]["json"]>[0] | null : string | null

Type parameters

  • T

Specs

Specs: Array<[string, string, boolean]>

StreamReportOptions

StreamReportOptions: object

Type declaration

  • configuration: Configuration
  • Optional forgettableBufferSize?: undefined | number
  • Optional forgettableNames?: Set<MessageName | null>
  • Optional includeFooter?: undefined | false | true
  • Optional includeInfos?: undefined | false | true
  • Optional includeLogs?: undefined | false | true
  • Optional includeWarnings?: undefined | false | true
  • Optional json?: undefined | false | true
  • stdout: Writable

TreeMap

TreeMap: object

Type declaration

TreeNode

TreeNode: object

Type declaration

  • Optional children?: Array<TreeNode> | TreeMap
  • Optional label?: undefined | string
  • Optional value?: formatUtils.Tuple

TreeifyNode

TreeifyNode: object

Type declaration

Tuple

Tuple<T>: keyof [Source<T>, T]

Type parameters

Variables

Const BASE_FORGETTABLE_BUFFER_SIZE

BASE_FORGETTABLE_BUFFER_SIZE: 5 = 5

Const BASE_FORGETTABLE_NAMES

BASE_FORGETTABLE_NAMES: Set<null | UNNAMED | EXCEPTION | MISSING_PEER_DEPENDENCY | CYCLIC_DEPENDENCIES | DISABLED_BUILD_SCRIPTS | BUILD_DISABLED | SOFT_LINK_BUILD | MUST_BUILD | MUST_REBUILD | BUILD_FAILED | RESOLVER_NOT_FOUND | FETCHER_NOT_FOUND | LINKER_NOT_FOUND | FETCH_NOT_CACHED | YARN_IMPORT_FAILED | REMOTE_INVALID | REMOTE_NOT_FOUND | RESOLUTION_PACK | CACHE_CHECKSUM_MISMATCH | UNUSED_CACHE_ENTRY | MISSING_LOCKFILE_ENTRY | WORKSPACE_NOT_FOUND | TOO_MANY_MATCHING_WORKSPACES | CONSTRAINTS_MISSING_DEPENDENCY | CONSTRAINTS_INCOMPATIBLE_DEPENDENCY | CONSTRAINTS_EXTRANEOUS_DEPENDENCY | CONSTRAINTS_INVALID_DEPENDENCY | CANT_SUGGEST_RESOLUTIONS | FROZEN_LOCKFILE_EXCEPTION | CROSS_DRIVE_VIRTUAL_LOCAL | FETCH_FAILED | DANGEROUS_NODE_MODULES | NODE_GYP_INJECTED | AUTHENTICATION_NOT_FOUND | INVALID_CONFIGURATION_KEY | NETWORK_ERROR | LIFECYCLE_SCRIPT | CONSTRAINTS_MISSING_FIELD | CONSTRAINTS_INCOMPATIBLE_FIELD | CONSTRAINTS_EXTRANEOUS_FIELD | CONSTRAINTS_INVALID_FIELD | AUTHENTICATION_INVALID | PROLOG_UNKNOWN_ERROR | PROLOG_SYNTAX_ERROR | PROLOG_EXISTENCE_ERROR | STACK_OVERFLOW_RESOLUTION | AUTOMERGE_FAILED_TO_PARSE | AUTOMERGE_IMMUTABLE | AUTOMERGE_SUCCESS | AUTOMERGE_REQUIRED | DEPRECATED_CLI_SETTINGS | PLUGIN_NAME_NOT_FOUND | INVALID_PLUGIN_REFERENCE | CONSTRAINTS_AMBIGUITY | CACHE_OUTSIDE_PROJECT | IMMUTABLE_INSTALL | IMMUTABLE_CACHE | INVALID_MANIFEST | PACKAGE_PREPARATION_FAILED | INVALID_RANGE_PEER_DEPENDENCY | INCOMPATIBLE_PEER_DEPENDENCY | DEPRECATED_PACKAGE | INCOMPATIBLE_OS | INCOMPATIBLE_CPU | FROZEN_ARTIFACT_EXCEPTION | TELEMETRY_NOTICE | PATCH_HUNK_FAILED> = new Set<MessageName | null>([MessageName.FETCH_NOT_CACHED, MessageName.UNUSED_CACHE_ENTRY])

Const CACHE_VERSION

CACHE_VERSION: 6 = 6

Const DEFAULT_LOCK_FILENAME

DEFAULT_LOCK_FILENAME: string & object = `yarn.lock` as Filename

Const DEFAULT_RC_FILENAME

DEFAULT_RC_FILENAME: string & object = `.yarnrc.yml` as Filename

Const ENVIRONMENT_PREFIX

ENVIRONMENT_PREFIX: "yarn_" = `yarn_`

Const FETCHER_CONCURRENCY

FETCHER_CONCURRENCY: 32 = 32

Const FormatType

FormatType: Type = formatUtils.Type

Const GROUP

GROUP: null | object = process.env.GITHUB_ACTIONS? {start: (what: string) => `::group::${what}\n`, end: (what: string) => `::endgroup::\n`}: process.env.TRAVIS? {start: (what: string) => `travis_fold:start:${what}\n`, end: (what: string) => `travis_fold:end:${what}\n`}: process.env.GITLAB_CI? {start: (what: string) => `section_start:${Math.floor(Date.now() / 1000)}:${what.toLowerCase().replace(/\W+/g, `_`)}\r\x1b[0K${what}\n`, end: (what: string) => `section_end:${Math.floor(Date.now() / 1000)}:${what.toLowerCase().replace(/\W+/g, `_`)}\r\x1b[0K`}: null

Const IGNORED_ENV_VARIABLES

IGNORED_ENV_VARIABLES: Set<string> = new Set([// "binFolder" is the magic location where the parent process stored the// current binaries; not an actual configuration settings`binFolder`,// "version" is set by Docker:// https://github.com/nodejs/docker-node/blob/5a6a5e91999358c5b04fddd6c22a9a4eb0bf3fbf/10/alpine/Dockerfile#L51`version`,// "flags" is set by Netlify; they use it to specify the flags to send to the// CLI when running the automatic `yarn install``flags`,// "gpg" and "profile" are used by the install.sh script:// https://classic.yarnpkg.com/install.sh`profile`,`gpg`,// "ignoreNode" is used to disable the Node version check`ignoreNode`,// "wrapOutput" was a variable used to indicate nested "yarn run" processes// back in Yarn 1.`wrapOutput`,])

Const IMPORTED_PATTERNS

IMPORTED_PATTERNS: Array<[RegExp, function]> = [// These ones come from Git urls[/^(git(?:\+(?:https|ssh))?:\/\/.*\.git)#(.*)$/, (version, $0, $1, $2) => `${$1}#commit=${$2}`],// These ones come from the GitHub HTTP endpoints[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/, (version, $0, $1 = ``, $2, $3) => `https://${$1}github.com/${$2}.git#commit=${$3}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/, (version, $0, $1 = ``, $2, $3) => `https://${$1}github.com/${$2}.git#commit=${$3}`],// These ones come from the npm registry[/^https?:\/\/[^/]+\/(?:@[^/]+\/)?([^/]+)\/-\/\1-[^/]+\.tgz(?:#|$)/, version => `npm:${version}`],// These ones come from the old Yarn offline mirror - we assume they came from npm[/^[^/]+\.tgz#[0-9a-f]+$/, version => `npm:${version}`],]

Const INSTALL_STATE_VERSION

INSTALL_STATE_VERSION: 1 = 1

Const LOCKFILE_VERSION

LOCKFILE_VERSION: 4 = 4

Const MAX_PREPARE_CONCURRENCY

MAX_PREPARE_CONCURRENCY: 2 = 2

Given a folder, prepares this project for use. Runs yarn install then yarn build if a package.json is found.

Const MULTIPLE_KEYS_REGEXP

MULTIPLE_KEYS_REGEXP: RegExp = / *, */g

Const PROGRESS_FRAMES

PROGRESS_FRAMES: string[] = [`⠋`, `⠙`, `⠹`, `⠸`, `⠼`, `⠴`, `⠦`, `⠧`, `⠇`, `⠏`]

Const PROGRESS_INTERVAL

PROGRESS_INTERVAL: 80 = 80

Const PROGRESS_STYLES

PROGRESS_STYLES: object = makeRecord({patrick: {date: [17, 3],chars: [`🍀`, `🌱`],size: 40,},simba: {date: [19, 7],chars: [`🦁`, `🌴`],size: 40,},jack: {date: [31, 10],chars: [`🎃`, `🦇`],size: 40,},hogsfather: {date: [31, 12],chars: [`🎉`, `🎄`],size: 40,},default: {chars: [`=`, `-`],size: 80,},})

Type declaration

  • [key: string]: T

Const SECRET

SECRET: "********" = `********`

Const SPECS

SPECS: Specs = [// Those three are different from includePrerelease[`^5.0.0`, `5.0.0-beta.13`, true],[`^1.0.0`, `1.0.0-rc1`, true],[`2.x`, `3.0.0-pre.0`, false],// From the semver test-suite...[[`2.x`, `2.0.0-pre.0`, true],[`2.x`, `2.1.0-pre.0`, true],[`1.1.x`, `1.1.0-a`, true],[`1.1.x`, `1.1.1-a`, true],[`*`, `1.0.0-rc1`, true],[`^1.0.0-0`, `1.0.1-rc1`, true],// https://github.com/yarnpkg/berry/pull/1748#discussion_r475268862// [`^1.0.0-rc2`, `1.0.1-rc1`, true],[`^1.0.0`, `1.0.1-rc1`, true],[`^1.0.0`, `1.1.0-rc1`, true],[`1 - 2`, `2.0.0-pre`, true],[`1 - 2`, `1.0.0-pre`, true],[`1.0 - 2`, `1.0.0-pre`, true],[`=0.7.x`, `0.7.0-asdf`, true],[`>=0.7.x`, `0.7.0-asdf`, true],[`<=0.7.x`, `0.7.0-asdf`, true],[`>=1.0.0 <=1.1.0`, `1.1.0-pre`, true],] as Specs,[`^1.0.0`, `2.0.0-rc1`, false],[`^1.2.3-rc2`, `2.0.0`, false],// These are important: false positives with fixed ranges[`1.0.0-alpha.37`, `1.0.0-alpha.39`, false],[`1.0.0-rc2`, `1.0.0-rc4`, false],[`1.0.0-rc4`, `1.0.0-rc2`, false],[`1.0.0-beta.1`, `1.0.0-beta.2`, false],]

Const TAG_REGEXP

TAG_REGEXP: RegExp = /^(?!v)[a-z0-9-.]+$/i

Const TRAILING_SLASH_REGEXP

TRAILING_SLASH_REGEXP: RegExp = /\/$/

Const VIRTUAL_ABBREVIATE

VIRTUAL_ABBREVIATE: 5 = 5

Const VIRTUAL_PROTOCOL

VIRTUAL_PROTOCOL: "virtual:" = `virtual:`

Const YARN_VERSION

YARN_VERSION: string | null

Const YarnVersion

YarnVersion: null | string = typeof YARN_VERSION !== `undefined`? YARN_VERSION: null

__non_webpack_require__

__non_webpack_require__: any

Const cache

cache: Map<string, Buffer | Promise<Buffer>> = new Map<string, Promise<Buffer> | Buffer>()

Const chalkInstance

chalkInstance: Chalk = new chalk.Instance(chalkOptions)

Const chalkOptions

chalkOptions: object = process.env.GITHUB_ACTIONS? {level: 2}: chalk.supportsColor? {level: chalk.supportsColor.level}: {level: 0}

Type declaration

  • level: number

Const colors

colors: Map<Type, null | (string | number)[]> = new Map([[Type.NO_HINT, null],[Type.NULL, [`#a853b5`, 129]],[Type.SCOPE, [`#d75f00`, 166]],[Type.NAME, [`#d7875f`, 173]],[Type.RANGE, [`#00afaf`, 37]],[Type.REFERENCE, [`#87afff`, 111]],[Type.NUMBER, [`#ffd700`, 220]],[Type.PATH, [`#d75fd7`, 170]],[Type.URL, [`#d75fd7`, 170]],[Type.ADDED, [`#5faf00`, 70]],[Type.REMOVED, [`#d70000`, 160]],[Type.CODE, [`#87afff`, 111]],[Type.SIZE, [`#ffd700`, 220]],])

Const defaultStyle

defaultStyle: string = (supportsEmojis && Object.keys(PROGRESS_STYLES).find(name => {const style = PROGRESS_STYLES[name];if (style.date && (style.date[0] !== now.getDate() || style.date[1] !== now.getMonth() + 1))return false;return true;})) || `default`

Const globalHttpAgent

globalHttpAgent: Agent = new HttpAgent({keepAlive: true})

Const globalHttpsAgent

globalHttpsAgent: Agent = new HttpsAgent({keepAlive: true})

Const gunzip

gunzip: function = promisify(zlib.gunzip)

Type declaration

    • (arg1: T1): Promise<TResult>
    • Parameters

      • arg1: T1

      Returns Promise<TResult>

Const gunzip

gunzip: function = promisify(zlib.gunzip)

Type declaration

    • (arg1: T1): Promise<TResult>
    • Parameters

      • arg1: T1

      Returns Promise<TResult>

Const gzip

gzip: function = promisify(zlib.gzip)

Type declaration

    • (arg1: T1): Promise<TResult>
    • Parameters

      • arg1: T1

      Returns Promise<TResult>

Const mapAndFilterSkip

mapAndFilterSkip: unique symbol = Symbol()

Const mapAndFindSkip

mapAndFindSkip: unique symbol = Symbol()

Const now

now: Date = new Date()

Const prepareLimit

prepareLimit: Limit = pLimit(MAX_PREPARE_CONCURRENCY)

Const rangesCache

rangesCache: Map<string, null | Range> = new Map<string, semver.Range | null>()

Let sigintRefCount

sigintRefCount: number = 0

Const signalToCodeMap

signalToCodeMap: Map<null | "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO", number> = new Map<NodeJS.Signals | null, number>([[`SIGINT`, 2], // ctrl-c[`SIGQUIT`, 3], // ctrl-\[`SIGKILL`, 9], // hard kill[`SIGTERM`, 15], // default signal for kill])

Const supportsColor

supportsColor: boolean = chalkOptions.level !== 0

Const supportsEmojis

supportsEmojis: boolean = [`iTerm.app`, `Apple_Terminal`].includes(process.env.TERM_PROGRAM!) || !!process.env.WT_SESSION

Const supportsHyperlinks

supportsHyperlinks: boolean = supportsColor && !process.env.GITHUB_ACTIONS

Functions

applyColor

  • applyColor(configuration: Configuration, value: string, formatType: Type | string): string

applyStyle

applyVirtualResolutionMutations

  • applyVirtualResolutionMutations(__namedParameters: object): void
  • This function is worth some documentation. It takes a set of packages, traverses them all, and generates virtual packages for each package that lists peer dependencies.

    We also take advantage of the tree traversal to detect which packages are actually used and which have disappeared, and to know which packages truly have an optional build (since a package may be optional in one part of the tree but not another).

    We also take advantage of the tree traversal to detect which packages are actually used and which have disappeared, and to know which packages truly have an optional build (since a package may be optional in one part of the tree but not another).

    Parameters

    • __namedParameters: object
      • accessibleLocators: Set<string & object>
      • allDescriptors: Map<string & object, Descriptor>
      • allPackages: Map<string & object, Package>
      • allResolutions: Map<string & object, string & object>
      • optionalBuilds: Set<string & object>
      • project: Project
      • report: null | Report
      • tolerateMissingPackages: boolean
      • volatileDescriptors: Set<string & object>

    Returns void

areDescriptorsEqual

areIdentsEqual

areLocatorsEqual

areVirtualPackagesEquivalent

assertNever

  • assertNever(arg: never): never

bindDescriptor

bindLocator

bufferStream

  • bufferStream(stream: Readable): Promise<Buffer>

buildIgnorePattern

  • buildIgnorePattern(ignorePatterns: Array<string>): null | string
  • Combines an Array of glob patterns into a regular expression.

    Parameters

    • ignorePatterns: Array<string>

      An array of glob patterns

    Returns null | string

    A string representing a regular expression or null if no glob patterns are provided

builtinModules

  • builtinModules(): Set<string>

checksumFile

checksumPattern

  • checksumPattern(pattern: string, __namedParameters: object): Promise<string>

convertDescriptorToLocator

convertLocatorToDescriptor

convertPackageToLocator

convertToIdent

convertToManifestRange

  • convertToManifestRange(range: string): string
  • The range used internally may differ from the range stored in the Manifest (package.json). This removes any params indicated for internal use. An internal param starts with "__".

    Parameters

    • range: string

      range to convert

    Returns string

convertToZip

copyPackage

del

  • del(target: string, options: Options): Promise<Buffer>

detectPackageManager

devirtualizeDescriptor

devirtualizeLocator

dynamicRequire

  • dynamicRequire(path: string): any

dynamicRequire

  • dynamicRequire(request: string): any

dynamicRequireNoCache

emitList

  • emitList(values: Array<formatUtils.Tuple>, __namedParameters: object): void

emitTree

  • emitTree(tree: TreeNode, __namedParameters: object): void

encodeUnsafeCharacters

  • encodeUnsafeCharacters(str: string): string

escapeRegExp

  • escapeRegExp(str: string): string

executePackageAccessibleBinary

  • executePackageAccessibleBinary(locator: Locator, binaryName: string, args: Array<string>, __namedParameters: object): Promise<number>
  • Execute a binary from the specified package.

    Note that "binary" in this sense means "a Javascript file". Actual native binaries cannot be executed this way, because we use Node in order to transparently read from the archives.

    Note that "binary" in this sense means "a Javascript file". Actual native binaries cannot be executed this way, because we use Node in order to transparently read from the archives.

    Parameters

    • locator: Locator

      The queried package

    • binaryName: string

      The name of the binary file to execute

    • args: Array<string>

      The arguments to pass to the file

    • __namedParameters: object
      • cwd: string & object
      • nodeArgs: string[]
      • project: Project
      • stderr: Writable
      • stdin: null | Readable
      • stdout: Writable

    Returns Promise<number>

executePackageScript

  • executePackageScript(locator: Locator, scriptName: string, args: Array<string>, __namedParameters: object): Promise<number>

executePackageShellcode

  • executePackageShellcode(locator: Locator, command: string, args: Array<string>, __namedParameters: object): Promise<number>

executeWorkspaceAccessibleBinary

  • executeWorkspaceAccessibleBinary(workspace: Workspace, binaryName: string, args: Array<string>, __namedParameters: object): Promise<number>
  • Execute a binary from the specified workspace

    Parameters

    • workspace: Workspace

      The queried package

    • binaryName: string

      The name of the binary file to execute

    • args: Array<string>

      The arguments to pass to the file

    • __namedParameters: object
      • cwd: string & object
      • stderr: Writable
      • stdin: null | Readable
      • stdout: Writable

    Returns Promise<number>

executeWorkspaceLifecycleScript

  • executeWorkspaceLifecycleScript(workspace: Workspace, lifecycleScriptName: string, __namedParameters: object): Promise<void>

executeWorkspaceScript

  • executeWorkspaceScript(workspace: Workspace, scriptName: string, args: Array<string>, __namedParameters: object): Promise<number>

execvp

  • execvp(fileName: string, args: Array<string>, opts: ExecvpOptions & object): Promise<object>
  • execvp(fileName: string, args: Array<string>, opts: ExecvpOptions & object): Promise<object>
  • execvp(fileName: string, args: Array<string>, opts: ExecvpOptions): Promise<object>

extractArchiveTo

  • extractArchiveTo<T>(tgz: Buffer, targetFs: T, __namedParameters?: object): Promise<T>

formatName

  • formatName(name: MessageName | null, __namedParameters: object): string

formatNameWithHyperlink

  • formatNameWithHyperlink(name: MessageName | null, __namedParameters: object): string

get

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

getArrayWithDefault

  • getArrayWithDefault<K, T>(map: Map<K, Array<T>>, key: K): T[]

getCacheKeyComponent

  • getCacheKeyComponent(checksum: string): null | string

Const getConfiguration

getDefaultGlobalFolder

  • getDefaultGlobalFolder(): string & object

getDefaultValue

getEnvironmentSettings

  • getEnvironmentSettings(): object

getExitCode

  • getExitCode(code: number | null, signal: NodeJS.Signals | null): number

getFactoryWithDefault

  • getFactoryWithDefault<K, T>(map: Map<K, T>, key: K, factory: function): T

getHashComponent

  • getHashComponent(checksum: string): string

getHomeFolder

  • getHomeFolder(): string & object

getIdentVendorPath

  • getIdentVendorPath(ident: Ident): string & object
  • The presence of a node_modules directory in the path is extremely common in the JavaScript ecosystem to denote whether a path belongs to a vendor or not. I considered using a more generic path for packages that aren't always JS-only (such as when using the Git fetcher), but that unfortunately caused various JS apps to start showing errors when working with git repos.

    As a result, all packages from all languages will follow this convention. At least it'll be consistent, and linkers will always have the ability to remap them to a different location if that's a critical requirement.

    As a result, all packages from all languages will follow this convention. At least it'll be consistent, and linkers will always have the ability to remap them to a different location if that's a critical requirement.

    Parameters

    Returns string & object

getIndent

  • getIndent(content: string): string

getMapWithDefault

  • getMapWithDefault<K, MK, MV>(map: Map<K, Map<MK, MV>>, key: K): Map<MK, MV>

getPackageAccessibleBinaries

  • getPackageAccessibleBinaries(locator: Locator, __namedParameters: object): Promise<Map<string, [Locator, string & object]>>

getRcFilename

  • getRcFilename(): string & object

getSetWithDefault

  • getSetWithDefault<K, T>(map: Map<K, Set<T>>, key: K): Set<T>

getWorkspaceAccessibleBinaries

  • getWorkspaceAccessibleBinaries(workspace: Workspace): Promise<Map<string, [Locator, string & object]>>

hasFd

  • hasFd(stream: null | Readable | Writable): boolean

hasPackageScript

  • hasPackageScript(locator: Locator, scriptName: string, __namedParameters: object): Promise<boolean>

hasParams

  • hasParams(params: ParsedUrlQuery | null): params

hasWorkspaceScript

  • hasWorkspaceScript(workspace: Workspace, scriptName: string): boolean

initializeConfiguration

  • initializeConfiguration<T>(value: object, cb: function): Promise<T>

initializePackageEnvironment

  • initializePackageEnvironment(locator: Locator, __namedParameters: object): Promise<object>

isFolderInside

isIndexableObject

  • isIndexableObject(value: unknown): value

isManifestFieldCompatible

  • isManifestFieldCompatible(rules: Array<string>, actual: string): boolean

isReportError

  • isReportError(error: Error): error

isVirtualDescriptor

  • isVirtualDescriptor(descriptor: Descriptor): boolean

isVirtualLocator

  • isVirtualLocator(locator: Locator): boolean

json

  • json<T>(value: Source<T>, formatType: T | string): any

makeArchiveFromDirectory

  • makeArchiveFromDirectory(source: PortablePath, __namedParameters?: object): Promise<ZipFS>

makeDescriptor

makeHash

  • makeHash<T>(...args: Array<BinaryLike | null>): T

makeIdent

  • makeIdent(scope: string | null, name: string): Ident

makeLocator

makePathWrapper

makeRange

  • makeRange(__namedParameters: object): string

Const makeRecord

  • makeRecord<T>(obj: object): object

makeScriptEnv

  • makeScriptEnv(__namedParameters: object): Promise<object & object>

mapAndFilter

  • mapAndFilter<In, Out>(iterable: Iterable<In>, cb: function): Array<Out>
  • Type parameters

    • In

    • Out

    Parameters

    • iterable: Iterable<In>
    • cb: function
        • (value: In): Out | typeof mapAndFilterSkip
        • Parameters

          • value: In

          Returns Out | typeof mapAndFilterSkip

    Returns Array<Out>

mapAndFind

  • mapAndFind<In, Out>(iterable: Iterable<In>, cb: function): Out | undefined
  • Type parameters

    • In

    • Out

    Parameters

    • iterable: Iterable<In>
    • cb: function
        • (value: In): Out | typeof mapAndFindSkip
        • Parameters

          • value: In

          Returns Out | typeof mapAndFindSkip

    Returns Out | undefined

maybeExecuteWorkspaceLifecycleScript

overrideType

  • overrideType<T>(val: unknown): val

parseBoolean

  • parseBoolean(value: unknown): boolean

parseDescriptor

  • parseDescriptor(string: string, strict?: boolean): Descriptor

parseFileStyleRange

  • parseFileStyleRange(range: string, __namedParameters: object): object

parseIdent

  • parseIdent(string: string): Ident

parseLocator

  • parseLocator(string: string, strict?: boolean): Locator

parseMap

parseProxy

  • parseProxy(specifier: string): object

parseRange

parseShape

parseSingleValue

parseValue

pipevp

  • pipevp(fileName: string, args: Array<string>, __namedParameters: object): Promise<object>
  • Parameters

    • fileName: string
    • args: Array<string>
    • __namedParameters: object
      • cwd: string & object
      • end: EndStrategy
      • env: object
        • [key: string]: string | undefined
      • stderr: Writable
      • stdin: null | Readable
      • stdout: Writable
      • strict: boolean

    Returns Promise<object>

post

  • post(target: string, body: Body, options: Options): Promise<Buffer>

prepareExternalProject

prettifyAsyncErrors

  • prettifyAsyncErrors<T>(fn: function, update: function): Promise<T>

prettifySyncErrors

  • prettifySyncErrors<T>(fn: function, update: function): T

pretty

prettyDependent

prettyDescriptor

prettyIdent

prettyLocator

prettyLocatorNoColors

  • prettyLocatorNoColors(locator: Locator): string

prettyRange

  • prettyRange(configuration: Configuration, range: string): string

prettyRangeNoColors

  • prettyRangeNoColors(range: string): string

prettyReference

  • prettyReference(configuration: Configuration, reference: string): string

prettyResolution

prettyWorkspace

put

  • put(target: string, body: Body, options: Options): Promise<Buffer>

releaseAfterUseAsync

  • releaseAfterUseAsync<T>(fn: function, cleanup?: function | null): Promise<T>

renamePackage

replaceEnvVariables

  • replaceEnvVariables(value: string, __namedParameters: object): string

request

  • request(target: string, body: Body, __namedParameters: object): Promise<Response<any>>

requirableIdent

  • requirableIdent(ident: Ident): string

satisfiesWithPrereleases

  • satisfiesWithPrereleases(version: string | null, range: string, loose?: boolean): boolean
  • Returns whether the given semver version satisfies the given range. Notably this supports prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example.

    This function exists because the semver.satisfies method does not include pre releases. This means ranges such as * would not satisfy 1.0.0-rc. The includePrerelease flag has a weird behavior and cannot be used (if you want to try it out, just run the semverUtils testsuite using this flag instead of our own implementation, and you'll see the failing cases).

    See https://github.com/yarnpkg/berry/issues/575 for more context.

    This function exists because the semver.satisfies method does not include pre releases. This means ranges such as * would not satisfy 1.0.0-rc. The includePrerelease flag has a weird behavior and cannot be used (if you want to try it out, just run the semverUtils testsuite using this flag instead of our own implementation, and you'll see the failing cases).

    See https://github.com/yarnpkg/berry/issues/575 for more context.

    Parameters

    • version: string | null
    • range: string
    • Default value loose: boolean = false

    Returns boolean

sigintHandler

  • sigintHandler(): void

slugifyIdent

  • slugifyIdent(ident: Ident): string

slugifyLocator

  • slugifyLocator(locator: Locator): string & object

sortDescriptors

sortMap

  • sortMap<T>(values: Iterable<T>, mappers: function | Array<function>): T[]

stringifyDescriptor

  • stringifyDescriptor(descriptor: Descriptor): string

stringifyIdent

  • stringifyIdent(ident: Ident): string

stringifyLocator

  • stringifyLocator(locator: Locator): string

stripBOM

  • stripBOM(content: string): string

transformConfiguration

treeNodeToJson

  • treeNodeToJson(printTree: TreeNode): any

treeNodeToTreeify

  • treeNodeToTreeify(printTree: TreeNode, __namedParameters: object): object

tryParseDescriptor

  • tryParseDescriptor(string: string, strict?: boolean): Descriptor | null

tryParseIdent

  • tryParseIdent(string: string): Ident | null

tryParseLocator

  • tryParseLocator(string: string, strict?: boolean): Locator | null

tuple

validRange

  • validRange(potentialRange: string): Range | null

Const validateTransform

  • validateTransform<T>(spec: object): object
  • Type parameters

    • T

    Parameters

    • spec: object
      • json: function
          • (val: T): any
          • Parameters

            • val: T

            Returns any

      • pretty: function
          • (configuration: any, val: T): string
          • Parameters

            • configuration: any
            • val: T

            Returns string

    Returns object

    • json: function
        • (val: T): any
        • Parameters

          • val: T

          Returns any

    • pretty: function
        • (configuration: any, val: T): string
        • Parameters

          • configuration: any
          • val: T

          Returns string

virtualizeDescriptor

virtualizePackage

Object literals

Const CorePlugin

CorePlugin: object

hooks

hooks: object

reduceDependency

validateProject

  • validateProject(project: Project, report: object): Promise<void>

validateWorkspace

  • validateWorkspace(workspace: Workspace, report: object): Promise<void>

Const coreDefinitions

coreDefinitions: object

bstatePath

bstatePath: object

default

default: string = `./.yarn/build-state.yml`

description

description: string = `Path of the file where the current state of the built packages must be stored`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

cacheFolder

cacheFolder: object

default

default: string = `./.yarn/cache`

description

description: string = `Folder where the cache files must be written`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

cacheKeyOverride

cacheKeyOverride: object

default

default: null = null

description

description: string = `A global cache key override; used only for test purposes`

type

type: STRING = SettingsType.STRING

checksumBehavior

checksumBehavior: object

default

default: string = `throw`

description

description: string = `Enumeration defining what to do when a checksum doesn't match expectations`

type

type: STRING = SettingsType.STRING

compressionLevel

compressionLevel: object

default

default: 0 | 3 | 5 | 2 | 1 | 4 | 8 | 6 | 7 | 9 | "mixed" = DEFAULT_COMPRESSION_LEVEL

description

description: string = `Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)`

type

type: NUMBER = SettingsType.NUMBER

values

values: (string | number)[] = [`mixed`, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

defaultLanguageName

defaultLanguageName: object

default

default: string = `node`

description

description: string = `Default language mode that should be used when a package doesn't offer any insight`

type

type: STRING = SettingsType.STRING

defaultProtocol

defaultProtocol: object

default

default: string = `npm:`

description

description: string = `Default resolution protocol used when resolving pure semver and tag ranges`

type

type: STRING = SettingsType.STRING

enableAbsoluteVirtuals

enableAbsoluteVirtuals: object

default

default: boolean = false

description

description: string = `If true, the virtual symlinks will use absolute paths if required [non portable!!]`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableColors

enableColors: object

default

default: boolean = formatUtils.supportsColor

defaultText

defaultText: string = `<dynamic>`

description

description: string = `If true, the CLI is allowed to use colors in its output`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableGlobalCache

enableGlobalCache: object

default

default: boolean = false

description

description: string = `If true, the system-wide cache folder will be used regardless of \`cache-folder\``

type

type: BOOLEAN = SettingsType.BOOLEAN

enableHyperlinks

enableHyperlinks: object

default

default: boolean = formatUtils.supportsHyperlinks

defaultText

defaultText: string = `<dynamic>`

description

description: string = `If true, the CLI is allowed to use hyperlinks in its output`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableImmutableCache

enableImmutableCache: object

default

default: boolean = false

description

description: string = `If true, the cache is reputed immutable and actions that would modify it will throw`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableInlineBuilds

enableInlineBuilds: object

default

default: boolean = isCI

defaultText

defaultText: string = `<dynamic>`

description

description: string = `If true, the CLI will print the build output on the command line`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableMirror

enableMirror: object

default

default: boolean = true

description

description: string = `If true, the downloaded packages will be retrieved and stored in both the local and global folders`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableNetwork

enableNetwork: object

default

default: boolean = true

description

description: string = `If false, the package manager will refuse to use the network if required to`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableProgressBars

enableProgressBars: object

default

default: undefined | false | true = !isCI && process.stdout.isTTY && process.stdout.columns > 22

defaultText

defaultText: string = `<dynamic>`

description

description: string = `If true, the CLI is allowed to show a progress bar for long-running events`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableScripts

enableScripts: object

default

default: boolean = true

description

description: string = `If true, packages are allowed to have install scripts by default`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableTelemetry

enableTelemetry: object

default

default: boolean = !isCI

description

description: string = `If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableTimers

enableTimers: object

default

default: boolean = true

description

description: string = `If true, the CLI is allowed to print the time spent executing commands`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableTransparentWorkspaces

enableTransparentWorkspaces: object

default

default: boolean = true

description

description: string = `If false, Yarn won't automatically resolve workspace dependencies unless they use the \`workspace:\` protocol`

type

type: BOOLEAN = SettingsType.BOOLEAN

globalFolder

globalFolder: object

default

default: string & object = folderUtils.getDefaultGlobalFolder()

description

description: string = `Folder where are stored the system-wide settings`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

httpProxy

httpProxy: object

default

default: null = null

description

description: string = `URL of the http proxy that must be used for outgoing http requests`

type

type: STRING = SettingsType.STRING

httpRetry

httpRetry: object

default

default: number = 3

description

description: string = `Retry times on http failure`

type

type: NUMBER = SettingsType.NUMBER

httpTimeout

httpTimeout: object

default

default: number = 60000

description

description: string = `Timeout of each http request in milliseconds`

type

type: NUMBER = SettingsType.NUMBER

httpsProxy

httpsProxy: object

default

default: null = null

description

description: string = `URL of the http proxy that must be used for outgoing https requests`

type

type: STRING = SettingsType.STRING

ignoreCwd

ignoreCwd: object

default

default: boolean = false

description

description: string = `If true, the \`--cwd\` flag will be ignored`

type

type: BOOLEAN = SettingsType.BOOLEAN

ignorePath

ignorePath: object

default

default: boolean = false

description

description: string = `If true, the local executable will be ignored when using the global one`

type

type: BOOLEAN = SettingsType.BOOLEAN

immutablePatterns

immutablePatterns: object

default

default: never[] = []

description

description: string = `Array of glob patterns; files matching them won't be allowed to change during immutable installs`

isArray

isArray: true = true

type

type: STRING = SettingsType.STRING

installStatePath

installStatePath: object

default

default: string = `./.yarn/install-state.gz`

description

description: string = `Path of the file where the install state will be persisted`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

lastUpdateCheck

lastUpdateCheck: object

default

default: null = null

description

description: string = `Last timestamp we checked whether new Yarn versions were available`

type

type: STRING = SettingsType.STRING

lockfileFilename

lockfileFilename: object

default

default: string & object = DEFAULT_LOCK_FILENAME

description

description: string = `Name of the files where the Yarn dependency tree entries must be stored`

type

type: STRING = SettingsType.STRING

networkConcurrency

networkConcurrency: object

default

default: number = Infinity

description

description: string = `Maximal number of concurrent requests`

type

type: NUMBER = SettingsType.NUMBER

packageExtensions

packageExtensions: object

description

description: string = `Map of package corrections to apply on the dependency tree`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = ``

type

type: ANY = SettingsType.ANY

preferAggregateCacheInfo

preferAggregateCacheInfo: object

default

default: boolean = isCI

description

description: string = `If true, the CLI will only print a one-line report of any cache changes`

type

type: BOOLEAN = SettingsType.BOOLEAN

preferInteractive

preferInteractive: object

default

default: boolean = false

description

description: string = `If true, the CLI will automatically use the interactive mode when called from a TTY`

type

type: BOOLEAN = SettingsType.BOOLEAN

preferTruncatedLines

preferTruncatedLines: object

default

default: boolean = false

description

description: string = `If true, the CLI will truncate lines that would go beyond the size of the terminal`

type

type: BOOLEAN = SettingsType.BOOLEAN

progressBarStyle

progressBarStyle: object

default

default: undefined = undefined

defaultText

defaultText: string = `<dynamic>`

description

description: string = `Which style of progress bar should be used (only when progress bars are enabled)`

type

type: STRING = SettingsType.STRING

rcFilename

rcFilename: object

default

default: string & object = getRcFilename()

description

description: string = `Name of the files where the configuration can be found`

type

type: STRING = SettingsType.STRING

telemetryInterval

telemetryInterval: object

default

default: number = 7

description

description: string = `Minimal amount of time between two telemetry uploads, in days`

type

type: NUMBER = SettingsType.NUMBER

telemetryUserId

telemetryUserId: object

default

default: null = null

description

description: string = `If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.`

type

type: STRING = SettingsType.STRING

unsafeHttpWhitelist

unsafeHttpWhitelist: object

default

default: never[] = []

description

description: string = `List of the hostnames for which http queries are allowed (glob patterns are supported)`

isArray

isArray: true = true

type

type: STRING = SettingsType.STRING

virtualFolder

virtualFolder: object

default

default: string = `./.yarn/$$virtual`

description

description: string = `Folder where the virtual packages (cf doc) will be mapped on the disk (must be named $$virtual)`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

yarnPath

yarnPath: object

default

default: null = null

description

description: string = `Path to the local executable that must be used over the global one`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

Const transforms

transforms: object

__computed

__computed: object = validateTransform({pretty: (configuration: Configuration, size: number) => {const thresholds = [`KB`, `MB`, `GB`, `TB`];let power = thresholds.length;while (power > 1 && size < 1024 ** power)power -= 1;const factor = 1024 ** power;const value = Math.floor(size * 100 / factor) / 100;return applyColor(configuration, `${value} ${thresholds[power - 1]}`, Type.NUMBER);},json: (size: number) => {return size;},})

Type declaration

  • json: function
      • (val: T): any
      • Parameters

        • val: T

        Returns any

  • pretty: function
      • (configuration: any, val: T): string
      • Parameters

        • configuration: any
        • val: T

        Returns string

Generated using TypeDoc