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

Architecture

Architecture: object

Type declaration

  • cpu: string
  • libc: string | null
  • os: string

ArchitectureSet

ArchitectureSet: object

Type declaration

  • cpu: Array<string> | null
  • libc: Array<string> | null
  • os: Array<string> | null

BaseSettingsDefinition

BaseSettingsDefinition<T>: object & object | object

Type parameters

Binary

Binary: []

Body

Body: null | string | Buffer | object

BuildDirective

BuildDirective: []

CacheOptions

CacheOptions: object

Type declaration

  • Optional mirrorWriteOnly?: undefined | false | true
  • Optional mockedPackages?: Set<LocatorHash>
  • Optional skipIntegrityCheck?: undefined | false | true
  • Optional unstablePackages?: Set<LocatorHash>

Caller

Caller: object

Type declaration

  • arguments: Array<string>
  • column: number | null
  • file: string | null
  • line: number | null
  • methodName: string

CommandContext

CommandContext: object

Type declaration

  • colorDepth: number
  • cwd: PortablePath
  • env: Record<string, string | undefined>
  • plugins: PluginConfiguration
  • quiet: boolean
  • stderr: Writable
  • stdin: Readable
  • stdout: Writable

ConfigurationDefinitionMap

ConfigurationDefinitionMap<V>: object

Type parameters

  • V

Type declaration

ConflictMarker

ConflictMarker: object

Type declaration

  • [key: string]: unknown
  • onConflict: string

ConflictMarkerWithValue

ConflictMarkerWithValue: object

Type declaration

  • onConflict: string
  • value: unknown

ConvertToZipPayload

ConvertToZipPayload: object

Type declaration

Deferred

Deferred<T>: object

Type parameters

  • T

Type declaration

  • promise: Promise<T>
  • reject: function
      • Parameters

        Returns void

  • resolve: function
      • (val: T): void
      • Parameters

        • val: T

        Returns void

DefinitionForType

DefinitionForType<T>: T extends Array<infer U> ? object : object

Type parameters

  • T

DefinitionForTypeHelper

DefinitionForTypeHelper<T>: T extends Map<string, infer U> ? object & object & object & object | object & object & object & object : T extends ToMapValue<infer U> ? object & object & object & object | object & object & object & object : SimpleDefinitionForType<T>

Type parameters

  • T

DescriptorHash

DescriptorHash: string & object

Unique hash of a package descriptor. Used as key in various places so that two descriptors can be quickly compared.

ExecErrorOptions

ExecErrorOptions: PipeErrorOptions & object

ExecutePackageAccessibleBinaryOptions

ExecutePackageAccessibleBinaryOptions: object

Type declaration

ExecutePackageScriptOptions

ExecutePackageScriptOptions: object

Type declaration

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

ExecuteWorkspaceAccessibleBinaryOptions

ExecuteWorkspaceAccessibleBinaryOptions: object

Type declaration

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

FetchOptions

FetchOptions: MinimalFetchOptions & object

FetchResult

FetchResult: object

Type declaration

  • Optional checksum?: string | null

    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/<scope>/<name> 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.

Field

Field: object

Type declaration

  • label: string
  • value: Tuple<any>

FilterKeys

FilterKeys<T, Filter>: object[keyof T]

Type parameters

  • T: object

  • Filter

FinalizeInstallData

FinalizeInstallData: object

Type declaration

  • Optional customData?: any

    A set of data that are preserved from one install to the next. Linkers are allowed to cache whatever they want (including ES-native data structures like Map and Set) as long as they remember to follow basic rules:

    • They have to be prepared for no custom data to be passed at all; Yarn is allowed to clear the cache at will.

    • They have to cache only things that are unlikely to change. For instance caching the packages' scripts field is fine, but caching their dependencies isn't (first because dependencies are provided by the core itself, so caching wouldn't make sense, but also because users may change the dependencies of any package via the resolutions field).

    And of course, they have to manage their own migration.

    • They have to be prepared for no custom data to be passed at all; Yarn is allowed to clear the cache at will.

    • They have to cache only things that are unlikely to change. For instance caching the packages' scripts field is fine, but caching their dependencies isn't (first because dependencies are provided by the core itself, so caching wouldn't make sense, but also because users may change the dependencies of any package via the resolutions field).

    And of course, they have to manage their own migration.

  • Optional records?: Array<FinalizeInstallStatus>

    A list of extra package instances that may have been installed on the disk. While we usually recommend to avoid this feature (one package should only be installed once in a project, virtual dependencies excluded), it may be required to duplicate installs in some cases - for instance to replicate the hoisting that would happen with the node-modules linking strategy.

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: formatUtils.Type
deprecated

Use {@link formatUtils.Type}

GetPackageAccessibleBinariesOptions

GetPackageAccessibleBinariesOptions: object

Type declaration

HardDependencies

HardDependencies: "dependencies" | "devDependencies"

HasPackageScriptOption

HasPackageScriptOption: object

Type declaration

IdentHash

IdentHash: string & object

Unique hash of a package descriptor. Used as key in various places so that two descriptors can be quickly compared.

InstallOptions

InstallOptions: object

Type declaration

  • cache: Cache

    Instance of the cache that the project will use when packages have to be fetched. Some fetches may occur even during the resolution, for example when resolving git packages.

  • Optional checkResolutions?: undefined | false | true

    If true, Yarn will check that the pre-existing resolutions found in the lockfile are coherent with the ranges that depend on them.

  • Optional fetcher?: Fetcher

    An optional override for the default fetching pipeline. This is for overrides only - if you need to add resolvers, prefer adding them through regular plugins instead.

  • Optional immutable?: undefined | false | true

    If true, Yarn will check that the lockfile won't change after the resolution step. Additionally, after the link step, Yarn will retrieve the list of files in immutablePatterns and check that they didn't get modified either.

  • Optional lockfileOnly?: undefined | false | true

    If true, Yarn will exclusively use the lockfile metadata. Setting this flag will cause it to ignore any change in the manifests, and to abort if any dependency isn't present in the lockfile.

  • Optional mode?: InstallMode

    Changes which artifacts are generated during the install. Check the enumeration documentation for details.

  • Optional persistProject?: undefined | false | true

    If true (the default), Yarn will update the workspace manifests once the install has completed.

  • report: Report

    Provide a report instance that'll be use to store the information emitted during the install process.

  • Optional resolver?: Resolver

    An optional override for the default resolution pipeline. This is for overrides only - if you need to add resolvers, prefer adding them through regular plugins instead.

InstallPackageExtraApi

InstallPackageExtraApi: object

Type declaration

  • holdFetchResult: function

    The core reclaims the virtual filesystem by default when the installPackage function returns. This may be annoying when working on parallel installers, since installPackage are guaranteed to work sequentially (and thus no two packages could be installed at the same time, since one's fs would be closed as soon as the second would start).

    To avoid that, you can call the holdFetchResult function from this extra API to indicate to the core that it shouldn't reclaim the filesystem until the API passed in parameter as finished executing. Note that this may lead to higher memory consumption (since multiple packages may be kept in memory), so you'll need to implement an upper bound to the number of concurrent package installs.

    To avoid that, you can call the holdFetchResult function from this extra API to indicate to the core that it shouldn't reclaim the filesystem until the API passed in parameter as finished executing. Note that this may lead to higher memory consumption (since multiple packages may be kept in memory), so you'll need to implement an upper bound to the number of concurrent package installs.

      • (promise: Promise<void>): void
      • Parameters

        • promise: Promise<void>

        Returns void

InstallState

InstallState: Pick<Project, typeof INSTALL_STATE_FIELDS[keyof typeof INSTALL_STATE_FIELDS][number]>

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

Unique hash of a package locator. Used as key in various places so that two locators can be quickly compared.

MapSettingsDefinition

MapSettingsDefinition: BaseSettingsDefinition<MAP> & object

MapValue

MapValue<T>: T extends Map<any, infer V> ? V : never

Type parameters

  • T

MapValueToObjectValue

MapValueToObjectValue<T>:

Type parameters

  • T

MergeObjects

MergeObjects<T, Accumulator>: T extends [] ? MergeObjects<Rest, Accumulator & U> : Accumulator

Type parameters

  • T: Array<unknown>

  • Accumulator

MinimalFetchOptions

MinimalFetchOptions: object

Type declaration

MinimalLinkOptions

MinimalLinkOptions: object

Type declaration

MinimalResolveOptions

MinimalResolveOptions: object

Type declaration

Options

Options: object

Type declaration

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

PackageAccessibleBinaries

PackageAccessibleBinaries: Map<string, Binary>

PackageExtension

PackageExtension: object | object | object & object

PackageExtensionData

PackageExtensionData: miscUtils.MapValueToObjectValue<miscUtils.MapValue<ConfigurationValueMap["packageExtensions"]>>

ParseRangeOptions

ParseRangeOptions: object

Type declaration

  • Optional parseSelector?: undefined | false | true

    Whether to parse the selector as a query string

  • Optional requireBindings?: undefined | false | true

    Throw an error if bindings are missing

  • Optional requireProtocol?: boolean | string

    Throw an error if the protocol is missing or is not the specified one

  • Optional requireSource?: undefined | false | true

    Throw an error if the source is missing

ParseRangeReturnType

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

Type parameters

PeerRequirement

PeerRequirement: object

Type declaration

PipeErrorOptions

PipeErrorOptions: object

Type declaration

  • code: number | null
  • fileName: string
  • signal: NodeJS.Signals | null

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>

PoolWorker

PoolWorker<TOut>: Worker & object

Type parameters

  • TOut

ProcessEnvironment

ProcessEnvironment: object

Type declaration

  • [key: string]: string

ProgressDefinition

ProgressDefinition: object

Type declaration

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

ProgressIterable

ProgressIterable: AsyncIterable<ProgressDefinition> & object

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

ResolvedRcFile

ResolvedRcFile: []

RestoreInstallStateOpts

RestoreInstallStateOpts: object

Type declaration

SectionOptions

SectionOptions: object

Type declaration

  • Optional reportFooter?: undefined | function
  • Optional reportHeader?: undefined | function
  • Optional skipIfEmpty?: undefined | false | true

SettingTransforms

SettingTransforms: object

Type declaration

  • getNativePaths: boolean
  • hideSecrets: boolean

SettingsDefinition

SettingsDefinitionNoDefault

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

ShapeSettingsDefinition

ShapeSettingsDefinition: BaseSettingsDefinition<SHAPE> & object

SimpleDefinitionForType

SimpleDefinitionForType<T>: SimpleSettingsDefinition & object

Type parameters

  • T

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<[]>

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 includeNames?: undefined | false | true
  • Optional includePrefix?: undefined | false | true
  • Optional includeWarnings?: undefined | false | true
  • Optional json?: undefined | false | true
  • stdout: Writable

SupportedArchitectures

SupportedArchitectures: object

Type declaration

  • cpu: Array<string> | null
  • libc: Array<string> | null
  • os: Array<string> | null

TimerOptions

TimerOptions: Pick<SectionOptions, "skipIfEmpty">

TreeMap

TreeMap: object

Type declaration

TreeNode

TreeNode: object

Type declaration

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

TreeRoot

TreeRoot: TreeNode & object

TreeifyNode

TreeifyNode: object

Type declaration

Tuple

Tuple<T>: keyof []

Type parameters

Type

Type: keyof typeof Type

WrapNetworkRequestInfo

WrapNetworkRequestInfo: httpUtils.Options & object

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 | INVALID_CONFIGURATION_VALUE | UNUSED_PACKAGE_EXTENSION | REDUNDANT_PACKAGE_EXTENSION | AUTO_NM_SUCCESS | NM_CANT_INSTALL_EXTERNAL_SOFT_LINK | NM_PRESERVE_SYMLINKS_REQUIRED | UPDATE_LOCKFILE_ONLY_SKIP_LINK | NM_HARDLINKS_MODE_DOWNGRADED | PROLOG_INSTANTIATION_ERROR | INCOMPATIBLE_ARCHITECTURE | GHOST_ARCHITECTURE | RESOLUTION_MISMATCH | PROLOG_LIMIT_EXCEEDED | NETWORK_DISABLED | NETWORK_UNSAFE_HTTP | RESOLUTION_FAILED | AUTOMERGE_GIT_ERROR | CONSTRAINTS_CHECK_FAILED> = new Set<MessageName | null>([MessageName.FETCH_NOT_CACHED, MessageName.UNUSED_CACHE_ENTRY])

Const CACHE_VERSION

CACHE_VERSION: 9 = 9

Const CLEAN_SEMVER_REGEXP

CLEAN_SEMVER_REGEXP: RegExp = /^(?:[\sv=]*?)((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\s*)$/

The RegExp from https://semver.org/ but modified to

  • allow the version to start with (?:[\sv=]*?)
  • allow the version to end with (?:\s*)
  • place the valid version in capture group one

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: object = formatUtils.Type
deprecated

Use {@link formatUtils.Type}

Type declaration

  • ADDED: "ADDED"
  • CODE: "CODE"
  • DEPENDENT: "DEPENDENT"
  • DESCRIPTOR: "DESCRIPTOR"
  • DURATION: "DURATION"
  • IDENT: "IDENT"
  • INSPECT: "INSPECT"
  • LOCATOR: "LOCATOR"
  • MARKDOWN: "MARKDOWN"
  • NAME: "NAME"
  • NO_HINT: "NO_HINT"
  • NULL: "NULL"
  • NUMBER: "NUMBER"
  • PACKAGE_EXTENSION: "PACKAGE_EXTENSION"
  • PATH: "PATH"
  • RANGE: "RANGE"
  • REFERENCE: "REFERENCE"
  • REMOVED: "REMOVED"
  • RESOLUTION: "RESOLUTION"
  • SCOPE: "SCOPE"
  • SETTING: "SETTING"
  • SIZE: "SIZE"
  • URL: "URL"

Const GROUP

GROUP: null | object = CI.GITHUB_ACTIONS? {start: (what: string) => `::group::${what}\n`, end: (what: string) => `::endgroup::\n`}: CI.TRAVIS? {start: (what: string) => `travis_fold:start:${what}\n`, end: (what: string) => `travis_fold:end:${what}\n`}: CI.GITLAB? {start: (what: string) => `section_start:${Math.floor(Date.now() / 1000)}:${what.toLowerCase().replace(/\W+/g, `_`)}[collapsed=true]\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([// Used by our test environment`isTestEnv`,`injectNpmUser`,`injectNpmPassword`,`injectNpm2FaToken`,// "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`,// "YARN_HOME" and "YARN_CONF_DIR" may be present as part of the unrelated "Apache Hadoop YARN" software project.// https://hadoop.apache.org/docs/r0.23.11/hadoop-project-dist/hadoop-common/SingleCluster.html`home`,`confDir`,// "YARN_REGISTRY", read by yarn 1.x, prevents yarn 2+ installations if set`registry`,])

Const IMPORTED_PATTERNS

IMPORTED_PATTERNS: Array<[]> = [// 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// Note: /download/ is used by custom registries like Taobao[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/, version => `npm:${version}`],// The GitHub package registry uses a different style of URLs[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/, version => `npm:${version}`],// FontAwesome too; what is it with these registries that made them think using a different url pattern was a good idea?[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/, version => `npm:${version}`],// JFrog, or Artifactory deployments at arbitrary domain names[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/, (version, $0) => structUtils.makeRange({protocol: `npm:`, source: null, selector: version, params: {__archiveUrl: $0}})],// 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: 2 = 2

Const LOCKFILE_VERSION

LOCKFILE_VERSION: 7 = 7

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 RESOLVED_RC_FILE

RESOLVED_RC_FILE: unique symbol = Symbol()

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],// These don't match with our patch but do without it[`<=5.0.0-beta.0`, `5.0.0-alpha.7`, true],]

Const TAG_REGEXP

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

Const TITLE_PROGRESS_FPS

TITLE_PROGRESS_FPS: 15 = 15

Const TRAILING_SLASH_REGEXP

TRAILING_SLASH_REGEXP: RegExp = /\/$/

Const Type

Type: object = {NO_HINT: `NO_HINT`,NULL: `NULL`,SCOPE: `SCOPE`,NAME: `NAME`,RANGE: `RANGE`,REFERENCE: `REFERENCE`,NUMBER: `NUMBER`,PATH: `PATH`,URL: `URL`,ADDED: `ADDED`,REMOVED: `REMOVED`,CODE: `CODE`,INSPECT: `INSPECT`,DURATION: `DURATION`,SIZE: `SIZE`,IDENT: `IDENT`,DESCRIPTOR: `DESCRIPTOR`,LOCATOR: `LOCATOR`,RESOLUTION: `RESOLUTION`,DEPENDENT: `DEPENDENT`,PACKAGE_EXTENSION: `PACKAGE_EXTENSION`,SETTING: `SETTING`,MARKDOWN: `MARKDOWN`,} as const

Type declaration

  • ADDED: "ADDED"
  • CODE: "CODE"
  • DEPENDENT: "DEPENDENT"
  • DESCRIPTOR: "DESCRIPTOR"
  • DURATION: "DURATION"
  • IDENT: "IDENT"
  • INSPECT: "INSPECT"
  • LOCATOR: "LOCATOR"
  • MARKDOWN: "MARKDOWN"
  • NAME: "NAME"
  • NO_HINT: "NO_HINT"
  • NULL: "NULL"
  • NUMBER: "NUMBER"
  • PACKAGE_EXTENSION: "PACKAGE_EXTENSION"
  • PATH: "PATH"
  • RANGE: "RANGE"
  • REFERENCE: "REFERENCE"
  • REMOVED: "REMOVED"
  • RESOLUTION: "RESOLUTION"
  • SCOPE: "SCOPE"
  • SETTING: "SETTING"
  • SIZE: "SIZE"
  • URL: "URL"

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

Const activeChildren

activeChildren: Set<ChildProcess> = new Set<ChildProcess>()

Let architecture

architecture: Architecture | undefined

Let architectureSet

architectureSet: ArchitectureSet | undefined

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 = CI.GITHUB_ACTIONS? {level: 2}: chalk.supportsColor? {level: chalk.supportsColor.level}: {level: 0}

Type declaration

  • level: number

Const chromeEvalRe

chromeEvalRe: RegExp = /\((\S*)(?::(\d+))(?::(\d+))\)/

Const chromeRe

chromeRe: RegExp = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i

Const colors

colors: Map<"NO_HINT" | "NULL" | "SCOPE" | "NAME" | "RANGE" | "REFERENCE" | "NUMBER" | "PATH" | "URL" | "ADDED" | "REMOVED" | "CODE" | "INSPECT" | "DURATION" | "SIZE" | "IDENT" | "DESCRIPTOR" | "LOCATOR" | "RESOLUTION" | "DEPENDENT" | "PACKAGE_EXTENSION" | "SETTING" | "MARKDOWN", null | [string, number]> = new Map<Type, [string, number] | null>([[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 conditionParser

conditionParser: function = makeParser(conditionRegex)

Type declaration

    • (str: string, check: function): boolean
    • Parameters

      • str: string
      • check: function
          • (name: string): boolean
          • Parameters

            • name: string

            Returns boolean

      Returns boolean

Const conditionRegex

conditionRegex: RegExp = /(os|cpu|libc)=([a-z0-9_-]+)/

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 dynamicRequireFsTimeCache

dynamicRequireFsTimeCache: Map<string & object, object> = new Map<PortablePath, {mtime: number;instance: any;}>()

Const fileCache

fileCache: Map<string & object, Buffer | Promise<Buffer>> = new Map<PortablePath, Promise<Buffer> | Buffer>()

Const globalHttpAgent

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

Const globalHttpsAgent

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

Const gunzip

gunzip: __promisify__ = promisify(zlib.gunzip)

Const gzip

gzip: __promisify__ = promisify(zlib.gzip)

Let hook

hook: any

Const isKonsole

isKonsole: boolean = !!process.env.KONSOLE_VERSION

Const isPublicRepository

isPublicRepository: boolean = GITHUB_ACTIONS && process.env.GITHUB_EVENT_PATH? !(xfs.readJsonSync(npath.toPortablePath(process.env.GITHUB_EVENT_PATH)).repository?.private ?? true): false

Const kTaskInfo

kTaskInfo: unique symbol = Symbol(`kTaskInfo`)

Const mapAndFilterSkip

mapAndFilterSkip: unique symbol = Symbol()

Const mapAndFindSkip

mapAndFindSkip: unique symbol = Symbol()

Const mockClient

mockClient: any = jest.fn()

Const mockExtend

mockExtend: jest.Mock = got.extend as jest.Mock

Const now

now: Date = new Date()

Const openUrl

openUrl: undefined | (Anonymous function) = typeof openUrlBinary !== `undefined`? async (url: string) => {try {await execUtils.execvp(openUrlBinary, [url], {cwd: ppath.cwd()});return true;} catch {return false;}}: undefined

Const openUrlBinary

openUrlBinary: undefined | string = new Map([[`darwin`, `open`],[`linux`, `xdg-open`],[`win32`, `explorer.exe`],]).get(process.platform)

Const prepareLimit

prepareLimit: Limit = pLimit(MAX_PREPARE_CONCURRENCY)

Const rangesCache

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

Const realRequire

realRequire: NodeRequire = eval(`require`)

Const s

s: symbol = configUtils.RESOLVED_RC_FILE

Const satisfiesWithPrereleasesCache

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

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`, `WarpTerminal`, `vscode`].includes(process.env.TERM_PROGRAM!) || !!process.env.WT_SESSION

Const supportsHyperlinks

supportsHyperlinks: boolean = supportsColor && !CI.GITHUB_ACTIONS && !CI.CIRCLE && !CI.GITLAB

Let workerPool

Functions

addLogFilterSupport

  • addLogFilterSupport(report: Report, __namedParameters: object): void

allSettledSafe

  • allSettledSafe<T>(promises: Array<Promise<T>>): Promise<T[]>

applyColor

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

applyHyperlink

  • applyHyperlink(configuration: Configuration, text: string, href: 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>
      • peerRequirements: Map<string, object>
      • project: Project
      • report: null | Report
      • volatileDescriptors: Set<string & object>

    Returns void

areDescriptorsEqual

areIdentsEqual

areLocatorsEqual

areVirtualPackagesEquivalent

assertNever

  • assertNever(arg: never): never

attachIdToTree

availableParallelism

  • availableParallelism(): any

bindDescriptor

  • Some descriptors only make sense when bound with some internal state. For instance that would be the case for the file: ranges, which require to be bound to their parent packages in order to resolve relative paths from the right location.

    This function will apply the specified parameters onto the requested descriptor, but only if it didn't get bound before (important to handle the case where we replace a descriptor by another, since when that happens the replacement has probably been already bound).

    This function will apply the specified parameters onto the requested descriptor, but only if it didn't get bound before (important to handle the case where we replace a descriptor by another, since when that happens the replacement has probably been already bound).

    Parameters

    • descriptor: Descriptor

      The original descriptor

    • params: object

      The parameters to encode in the range

      • [key: string]: string

    Returns Descriptor

bindLocator

  • Some locators only make sense when bound with some internal state. For instance that would be the case for the file: references, which require to be bound to their parent packages in order to resolve relative paths from the right location.

    This function will apply the specified parameters onto the requested locator, but only if it didn't get bound before (important to handle the case where we replace a locator by another, since when that happens the replacement has probably been already bound).

    This function will apply the specified parameters onto the requested locator, but only if it didn't get bound before (important to handle the case where we replace a locator by another, since when that happens the replacement has probably been already bound).

    Parameters

    • locator: Locator

      The original locator

    • params: object

      The parameters to encode in the reference

      • [key: string]: string

    Returns Locator

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

  • checksumFile(path: PortablePath, __namedParameters?: object): Promise<string>

checksumPattern

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

clean

  • clean(potentialVersion: string): string | null

convertDescriptorToLocator

  • Turns a descriptor into a locator.

    Note that this process may be unsafe, as descriptors may reference multiple packages, putting them at odd with locators' expected semantic. Only makes sense when used with single-resolution protocols, for instance file:.

    Note that this process may be unsafe, as descriptors may reference multiple packages, putting them at odd with locators' expected semantic. Only makes sense when used with single-resolution protocols, for instance file:.

    Parameters

    • descriptor: Descriptor

      The descriptor to convert into a locator.

    Returns Locator

convertLocatorToDescriptor

  • Turns a locator into a descriptor.

    This should be safe to do regardless of the locator, since all locator references are expected to be valid descriptor ranges.

    This should be safe to do regardless of the locator, since all locator references are expected to be valid descriptor ranges.

    Parameters

    • locator: Locator

      The locator to convert into a descriptor.

    Returns Descriptor

convertMapsToIndexableObjects

convertPackageToLocator

  • Turns a package structure into a simple locator. You won't often need to call this function since packages are already valid locators by virtue of structural inheritance.

    This function is only useful if you absolutely need to remove the non-locator fields from a structure before storing it somewhere.

    This function is only useful if you absolutely need to remove the non-locator fields from a structure before storing it somewhere.

    Parameters

    • pkg: Package

      The package to convert into a locator.

    Returns Locator

convertToIdent

  • Turns a compatible source to an ident. You won't really have to use this function since by virtue of structural inheritance all descriptors and locators are already valid idents.

    This function is only useful if you absolutely need to remove the non-ident fields from a structure before storing it somewhere.

    This function is only useful if you absolutely need to remove the non-ident fields from a structure before storing it somewhere.

    Parameters

    Returns Ident

convertToManifestRange

  • convertToManifestRange(range: string): string
  • Some bindings are internal-only and not meant to be displayed anywhere (for instance that's the case with the parent locator bound to the file: ranges).

    this function strips them from a range.

    this function strips them from a range.

    Parameters

    • range: string

    Returns string

convertToZip

copyPackage

del

  • del(target: string, __namedParameters: object): Promise<Buffer>

detectPackageManager

devirtualizeDescriptor

devirtualizeLocator

dynamicRequire

  • dynamicRequire(path: string, opts?: undefined | object): any
  • dynamicRequire(path: PortablePath, opts: object): any

dynamicRequireFsTime

dynamicRequireNoCache

  • dynamicRequireNoCache(path: string): any

dynamicRequireNode

  • dynamicRequireNode(path: string): any

emitList

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

emitTree

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

encodeUnsafeCharacters

  • encodeUnsafeCharacters(str: string): string

ensureDevirtualizedDescriptor

ensureDevirtualizedLocator

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[]
      • packageAccessibleBinaries: undefined | Map<string, [Locator, string & object]>
      • 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
      • packageAccessibleBinaries: undefined | Map<string, [Locator, 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>

Const findLastIndex

  • findLastIndex<T>(array: Array<T>, predicate: function, thisArg?: any): number
  • Type parameters

    • T

    Parameters

    • array: Array<T>
    • predicate: function
        • (value: T, index: number, obj: Array<T>): unknown
        • Parameters

          • value: T
          • index: number
          • obj: Array<T>

          Returns unknown

    • Optional thisArg: any

    Returns number

formatName

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

formatNameWithHyperlink

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

get

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

getArchitecture

  • getArchitecture(): object

getArchitectureName

  • getArchitectureName(architecture?: object): string

getArchitectureSet

  • getArchitectureSet(): object

getArrayWithDefault

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

getCacheKeyComponent

  • getCacheKeyComponent(checksum: string): null | string

getCachedFile

getCaller

  • getCaller(): null | object

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

getLibc

  • getLibc(): null | "glibc" | "musl"

getMapWithDefault

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

getNetworkSettings

  • getNetworkSettings(target: string | URL, opts: object): object

getNormalized

getPackageAccessibleBinaries

getRcFilename

  • getRcFilename(): string & object

getSetWithDefault

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

getSource

  • getSource(value: unknown): null | string

getValue

  • getValue(value: unknown): unknown

getValueByTree

  • getValueByTree(valueBase: unknown): unknown

getValueType

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

hasProperty

  • hasProperty<T>(data: Record<string, unknown>, key: T): data

hasWorkspaceScript

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

Const initConfigurationPlugin

  • initConfigurationPlugin(configuration: string): Promise<object>

initializeConfiguration

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

initializePackageEnvironment

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

initializeWorkspaceEnvironment

  • initializeWorkspaceEnvironment(workspace: Workspace, __namedParameters: object): Promise<object>

isConflictMarker

  • isConflictMarker(data: unknown): data

isFolderInside

isIndexableObject

  • isIndexableObject(value: unknown): value

isObject

  • isObject(data: unknown): data

isPackageCompatible

  • isPackageCompatible(pkg: Package, architectures: nodeUtils.ArchitectureSet): boolean

isPathLike

  • isPathLike(value: string): boolean

isReportError

  • isReportError(error: Error): error

isResolvedRcFile

  • isResolvedRcFile(value: unknown): value

isTaggedYarnVersion

  • isTaggedYarnVersion(version: string | null): boolean

isVirtualDescriptor

  • isVirtualDescriptor(descriptor: Descriptor): boolean

isVirtualLocator

  • isVirtualLocator(locator: Locator): boolean

json

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

jsonOrPretty

  • jsonOrPretty<T>(outputJson: boolean, configuration: Configuration, __namedParameters: []): any

makeArchiveFromDirectory

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

makeDeferred

makeDescriptor

makeHash

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

makeIdent

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

makeLocator

Const makeLockfileChecksum

  • makeLockfileChecksum(normalizedContent: string): string

makePathWrapper

makeRange

  • makeRange(__namedParameters: object): string
  • Turn the components returned by parseRange back into a string. Check parseRange for more details.

    Parameters

    • __namedParameters: object
      • params: null | ParsedUrlQuery
      • protocol: null | string
      • selector: string
      • source: null | string

    Returns 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

mark

maybeExecuteWorkspaceLifecycleScript

mergeIntoTarget

  • mergeIntoTarget<T, S>(target: T, ...sources: S): MergeObjects<S, T>
  • Merges multiple objects into the target argument.

    Important: This function mutates the target argument.

    Custom classes inside the target parameter are supported (e.g. comment-json's CommentArray - comments from target will be preserved).

    Important: This function mutates the target argument.

    Custom classes inside the target parameter are supported (e.g. comment-json's CommentArray - comments from target will be preserved).

    see

    toMerged for a version that doesn't mutate the target argument

    Type parameters

    • T: object

    • S: Array<object>

    Parameters

    • target: T
    • Rest ...sources: S

    Returns MergeObjects<S, T>

normalizeSlashes

  • normalizeSlashes(str: string): string & object

normalizeValue

  • normalizeValue(data: unknown): object & object

overrideType

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

parseBoolean

  • parseBoolean(value: unknown): boolean

parseDescriptor

  • parseDescriptor(string: string, strict?: boolean): Descriptor
  • Parses a string into a descriptor

    Throws an error if the descriptor cannot be parsed.

    Throws an error if the descriptor cannot be parsed.

    Parameters

    • string: string

      The descriptor string (eg. lodash@^1.0.0)

    • Default value strict: boolean = false

      If false, the range is optional (unknown will be used as fallback)

    Returns Descriptor

parseFileStyleRange

  • parseFileStyleRange(range: string, __namedParameters: object): object
  • File-style ranges are bound to a parent locators that we need in order to resolve relative paths to the location of their parent packages. This function wraps parseRange to automatically extract the parent locator from the bindings and return it along with the selector.

    Parameters

    • range: string
    • __namedParameters: object
      • protocol: string

    Returns object

    • parentLocator: Locator
    • path: string & object

parseIdent

  • parseIdent(string: string): Ident

parseLocator

  • parseLocator(string: string, strict?: boolean): Locator
  • Parses a string into a locator

    Throws an error if the locator cannot be parsed.

    Throws an error if the locator cannot be parsed.

    Parameters

    • string: string

      The locator string (eg. lodash@1.0.0)

    • Default value strict: boolean = false

      If false, the reference is optional (unknown will be used as fallback)

    Returns Locator

parseMap

parseMessageName

parseOptionalBoolean

  • parseOptionalBoolean(value: unknown): boolean | undefined

parseProxy

  • parseProxy(specifier: string): object

parseRange

  • Parses a range into its constituents. Ranges typically follow these forms, with both protocol and bindings being optionals:

    <protocol>:<selector>::<bindings>
    <protocol>:<source>#<selector>::<bindings>

    The selector is intended to "refine" the source, and is required. The source itself is optional (for instance we don't need it for npm packages, but we do for git dependencies).

    <protocol>:<selector>::<bindings>
    <protocol>:<source>#<selector>::<bindings>

    The selector is intended to "refine" the source, and is required. The source itself is optional (for instance we don't need it for npm packages, but we do for git dependencies).

    Type parameters

    Parameters

    • range: string
    • Optional opts: Opts

    Returns ParseRangeReturnType<Opts>

parseShape

parseSingleValue

parseStackLine

  • parseStackLine(line: string): Caller | null

parseTar

  • parseTar(tgz: Buffer): AsyncGenerator<ReadEntry, void, unknown>

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, __namedParameters: object): Promise<Buffer>

prepareExternalProject

prettifyAsyncErrors

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

prettifySyncErrors

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

pretty

prettyDependent

prettyDescriptor

prettyField

  • prettyField(configuration: Configuration, __namedParameters: object): string

prettyIdent

prettyList

  • prettyList<T>(configuration: Configuration, values: Iterable<Source<T>>, formatType: T | string, __namedParameters?: object): string

prettyLocator

prettyLocatorNoColors

  • prettyLocatorNoColors(locator: Locator): string

prettyNetworkError

  • prettyNetworkError(response: Promise<Response<any>>, __namedParameters: object): Promise<Response<any>>

prettyRange

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

prettyRangeNoColors

  • prettyRangeNoColors(range: string): string

prettyReference

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

prettyResolution

prettyResponseCode

  • prettyResponseCode(__namedParameters: object, configuration: Configuration): string

prettyWorkspace

put

  • put(target: string, body: Body, __namedParameters: object): Promise<Buffer>

releaseAfterUseAsync

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

renamePackage

replaceEnvVariables

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

reportExitStatus

  • reportExitStatus(code: number | null, signal: string | null, __namedParameters: object): void

request

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

requestImpl

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

resolveRcFiles

  • resolveRcFiles(rcFiles: Array<[]>): null | [string, object, symbol]

resolveValueAt

  • resolveValueAt(rcFiles: Array<[]>, path: Array<string>, key: string, firstVisiblePosition: number, resolveAtPosition: number): ResolvedRcFile | null

resolvedRcFile

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

sigtermHandler

  • sigtermHandler(): 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

stringifyMessageName

  • stringifyMessageName(name: MessageName | number): string

stripBOM

  • stripBOM(content: string): string

toConditionLine

  • toConditionLine(name: string, rawTokens: Array<string>): string

toConditionToken

  • toConditionToken(name: string, raw: string): string

toMerged

  • Merges multiple objects into a single one, without mutating any arguments.

    Custom classes are not supported (i.e. comment-json's comments will be lost).

    Custom classes are not supported (i.e. comment-json's comments will be lost).

    Type parameters

    • S: Array<object>

    Parameters

    • Rest ...sources: S

    Returns MergeObjects<S, object>

transformConfiguration

treeNodeToJson

  • treeNodeToJson(printTree: TreeNode): any

treeNodeToTreeify

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

tryParseDescriptor

  • tryParseDescriptor(string: string, strict?: boolean): Descriptor | null
  • Parses a string into a descriptor

    Returns null if the descriptor cannot be parsed.

    Returns null if the descriptor cannot be parsed.

    Parameters

    • string: string

      The descriptor string (eg. lodash@^1.0.0)

    • Default value strict: boolean = false

      If false, the range is optional (unknown will be used as fallback)

    Returns Descriptor | null

tryParseIdent

  • tryParseIdent(string: string): Ident | null

tryParseLocator

  • tryParseLocator(string: string, strict?: boolean): Locator | null
  • Parses a string into a locator

    Returns null if the locator cannot be parsed.

    Returns null if the locator cannot be parsed.

    Parameters

    • string: string

      The locator string (eg. lodash@1.0.0)

    • Default value strict: boolean = false

      If false, the reference is optional (unknown will be used as fallback)

    Returns Locator | null

tryParseOptionalBoolean

  • tryParseOptionalBoolean(value: unknown): boolean | undefined | null

tryParseOptionalBoolean

  • tryParseOptionalBoolean(value: unknown, __namedParameters: object): undefined | null | false | true

tryParseRange

  • Parses a range into its constituents. Ranges typically follow these forms, with both protocol and bindings being optionals:

    <protocol>:<selector>::<bindings>
    <protocol>:<source>#<selector>::<bindings>

    The selector is intended to "refine" the source, and is required. The source itself is optional (for instance we don't need it for npm packages, but we do for git dependencies).

    <protocol>:<selector>::<bindings>
    <protocol>:<source>#<selector>::<bindings>

    The selector is intended to "refine" the source, and is required. The source itself is optional (for instance we don't need it for npm packages, but we do for git dependencies).

    Type parameters

    Parameters

    • range: string
    • Optional opts: Opts

    Returns ParseRangeReturnType<Opts> | null

tuple

validRange

  • validRange(potentialRange: string): Range | null

validateEnum

  • validateEnum<T>(def: object, value: string): T

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

wrapOutput

  • wrapOutput(): object

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 INSTALL_STATE_FIELDS

INSTALL_STATE_FIELDS: object

restoreBuildState

restoreBuildState: ["storedBuildState"] = [`storedBuildState`,] as const

restoreLinkersCustomData

restoreLinkersCustomData: ["linkersCustomData"] = [`linkersCustomData`,] as const

restoreResolutions

restoreResolutions: ["accessibleLocators", "conditionalLocators", "disabledLocators", "optionalBuilds", "storedDescriptors", "storedResolutions", "storedPackages", "lockFileChecksum"] = [`accessibleLocators`,`conditionalLocators`,`disabledLocators`,`optionalBuilds`,`storedDescriptors`,`storedResolutions`,`storedPackages`,`lockFileChecksum`,] as const

Const TestPlugin

TestPlugin: object

fetchers

fetchers: NoopFetcher[] = [NoopFetcher,]

resolvers

resolvers: (UnboundDescriptorResolver | ResolutionDependencyResolver)[] = [UnboundDescriptorResolver,ResolutionDependencyResolver,]

Const coreDefinitions

coreDefinitions: object

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 | 1 | 5 | 2 | 3 | 4 | 6 | 7 | 8 | 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

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 = true

description

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

type

type: BOOLEAN = SettingsType.BOOLEAN

enableHardenedMode

enableHardenedMode: object

default

default: null | false | true = isPR && isPublicRepository

defaultText

defaultText: string = `<true on public PRs>`

description

description: string = `If true, automatically enable --check-resolutions --refresh-lockfile on installs`

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

enableMessageNames

enableMessageNames: object

default

default: boolean = true

description

description: string = `If true, the CLI will prefix most messages with codes suitable for search engines`

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: boolean = !isCI

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

enableStrictSettings

enableStrictSettings: object

default

default: boolean = true

description

description: string = `If true, unknown settings will cause Yarn to abort`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableStrictSsl

enableStrictSsl: object

default

default: boolean = true

description

description: string = `If false, SSL certificate errors will be ignored`

type

type: BOOLEAN = SettingsType.BOOLEAN

enableTelemetry

enableTelemetry: object

default

default: boolean = true

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 all system-global files are stored`

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

httpsCaFilePath

httpsCaFilePath: object

default

default: null = null

description

description: string = `A path to a file containing one or multiple Certificate Authority signing certificates`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

httpsCertFilePath

httpsCertFilePath: object

default

default: null = null

description

description: string = `Path to file containing certificate chain in PEM format`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

httpsKeyFilePath

httpsKeyFilePath: object

default

default: null = null

description

description: string = `Path to file containing private key in PEM format`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

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

logFilters

logFilters: object

concatenateValues

concatenateValues: true = true

description

description: string = `Overrides for log levels`

isArray

isArray: true = true

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

code

code: object

default

default: undefined = undefined

description

description: string = `Code of the messages covered by this override`

type

type: STRING = SettingsType.STRING

level

level: object

default

default: undefined = undefined

description

description: string = `Log level override, set to null to remove override`

isNullable

isNullable: true = true

type

type: STRING = SettingsType.STRING

values

values: (Error | Warning | Info | Discard)[] = Object.values(formatUtils.LogLevel)

pattern

pattern: object

default

default: undefined = undefined

description

description: string = `Code of the patterns covered by this override`

type

type: STRING = SettingsType.STRING

text

text: object

default

default: undefined = undefined

description

description: string = `Code of the texts covered by this override`

type

type: STRING = SettingsType.STRING

networkConcurrency

networkConcurrency: object

default

default: number = 50

description

description: string = `Maximal number of concurrent requests`

type

type: NUMBER = SettingsType.NUMBER

networkSettings

networkSettings: object

description

description: string = `Network settings per hostname (glob patterns are supported)`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = ``

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

enableNetwork

enableNetwork: object

default

default: null = null

description

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

type

type: BOOLEAN = SettingsType.BOOLEAN

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

httpsCaFilePath

httpsCaFilePath: object

default

default: null = null

description

description: string = `Path to file containing one or multiple Certificate Authority signing certificates`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

httpsCertFilePath

httpsCertFilePath: object

default

default: null = null

description

description: string = `Path to file containing certificate chain in PEM format`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

httpsKeyFilePath

httpsKeyFilePath: object

default

default: null = null

description

description: string = `Path to file containing private key in PEM format`

type

type: ABSOLUTE_PATH = SettingsType.ABSOLUTE_PATH

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

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 = `The extension that will be applied to any package whose version matches the specified range`

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

dependencies

dependencies: object

description

description: string = `The set of dependencies that must be made available to the current package in order for it to work properly`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = `A range`

type

type: STRING = SettingsType.STRING

peerDependencies

peerDependencies: object

description

description: string = `Inherited dependencies - the consumer of the package will be tasked to provide them`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = `A semver range`

type

type: STRING = SettingsType.STRING

peerDependenciesMeta

peerDependenciesMeta: object

description

description: string = `Extra information related to the dependencies listed in the peerDependencies field`

type

type: MAP = SettingsType.MAP

valueDefinition

valueDefinition: object

description

description: string = `The peerDependency meta`

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

optional

optional: object

default

default: boolean = false

description

description: string = `If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error`

type

type: BOOLEAN = SettingsType.BOOLEAN

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

supportedArchitectures

supportedArchitectures: object

description

description: string = `Architectures that Yarn will fetch and inject into the resolver`

type

type: SHAPE = SettingsType.SHAPE

properties

properties: object

cpu

cpu: object

default

default: string[] = [`current`]

description

description: string = `Array of supported process.arch strings, or null to target them all`

isArray

isArray: true = true

isNullable

isNullable: true = true

type

type: STRING = SettingsType.STRING

libc

libc: object

default

default: string[] = [`current`]

description

description: string = `Array of supported libc libraries, or null to target them all`

isArray

isArray: true = true

isNullable

isNullable: true = true

type

type: STRING = SettingsType.STRING

os

os: object

default

default: string[] = [`current`]

description

description: string = `Array of supported process.platform strings, or null to target them all`

isArray

isArray: true = true

isNullable

isNullable: true = true

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, {text, format, paragraphs}: {text: string, format: ColorFormat, paragraphs: boolean}) => {return formatMarkdownish(text, {format, paragraphs});},json: ({text}: {text: string, format: ColorFormat, paragraphs: boolean}) => {return text;},})

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