@yarnpkg/nm
Index
Functions
buildLocatorMap
Parameters
nodeModulesTree: NodeModulesTree
Returns NodeModulesLocatorMap
buildNodeModulesTree
Parameters
pnp: PnpApi
PnP API
options: NodeModulesTreeOptions
Returns { errors: NodeModulesTreeErrors; preserveSymlinksRequired: boolean; tree: null | NodeModulesTree }
hoisted
node_modules
directories representation in-memoryerrors: NodeModulesTreeErrors
preserveSymlinksRequired: boolean
tree: null | NodeModulesTree
getArchivePath
Returns path to archive, if package location is inside the archive.
Parameters
packagePath: PortablePath
package location
Returns null | PortablePath
path to archive is location is insde the archive or null otherwise
hoist
Hoists package tree.
The root node of a tree must has id: '.'. This function does not mutate its arguments, it hoists and returns tree copy.
Parameters
tree: HoisterTree
package tree (cycles in the tree are allowed)
opts: HoistOptions = {}
Returns HoisterResult
hoisted tree copy
Type Aliases
HoisterResult
Type declaration
dependencies: Set<HoisterResult>
identName: PackageName
name: PackageName
references: Set<string>
HoisterTree
Type declaration
dependencies: Set<HoisterTree>
optionaldependencyKind?: HoisterDependencyKind
optionalhoistPriority?: number
identName: PackageName
name: PackageName
peerNames: Set<PackageName>
reference: string
NodeModulesBaseNode
Type declaration
dirList: Set<Filename>
NodeModulesLocatorMap
NodeModulesPackageNode
Type declaration
aliases: string[]
optionaldirList?: undefined
linkType: LinkType
locator: LocatorKey
nodePath: string
target: PortablePath
NodeModulesTree
Node modules tree - a map of every folder within the node_modules, along with their directory listing and whether they are a symlink and their location.
Sample contents: /home/user/project/node_modules -> {dirList: ['foo', 'bar']} /home/user/project/node_modules/foo -> {target: '/home/user/project/.yarn/.cache/foo.zip/node_modules/foo', linkType: 'HARD'} /home/user/project/node_modules/bar -> {target: '/home/user/project/packages/bar', linkType: 'SOFT'}
Retrieve full package list and build hoisted
node_modules
directories representation in-memory.