Skip to main content

@yarnpkg/nm

Index

Functions

buildLocatorMap

buildNodeModulesTree

  • Retrieve full package list and build hoisted node_modules directories representation in-memory.


    Parameters

    Returns { errors: NodeModulesTreeErrors; preserveSymlinksRequired: boolean; tree: null | NodeModulesTree }

    hoisted node_modules directories representation in-memory

    • errors: NodeModulesTreeErrors
    • preserveSymlinksRequired: boolean
    • tree: null | NodeModulesTree

getArchivePath

  • Returns path to archive, if package location is inside the archive.


    Parameters

    Returns null | PortablePath

    path to archive is location is insde the archive or null otherwise

References

HoisterDependencyKind

HoisterResult

Re-exports HoisterResult

HoisterTree

Re-exports HoisterTree

hoist

Re-exports hoist

Type Aliases

NodeModulesBaseNode

NodeModulesBaseNode: { dirList: Set<Filename> }

Type declaration

NodeModulesLocatorMap

NodeModulesLocatorMap: Map<LocatorKey, { aliases: string[]; linkType: LinkType; locations: PortablePath[]; target: PortablePath }>

NodeModulesPackageNode

NodeModulesPackageNode: { aliases: string[]; dirList?: undefined; linkType: LinkType; locator: LocatorKey; nodePath: string; target: PortablePath }

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'}