Skip to main content

PURL Type Definition: npm

  • Type Name: Node NPM packages
  • Description: PURL type for npm packages.
  • Schema ID: https://packageurl.org/types/npm-definition.json

PURL Syntax

The structure of a PURL for this package type is:

pkg:npm/<namespace>/<name>@<version>?<qualifiers>#<subpath>

Repository Information

Namespace definition

  • Requirement: Optional
  • Case Sensitive: Yes
  • Native Label: scope
  • Note: The namespace is used for the scope of a scoped NPM package. The npm scope @ sign prefix is always percent encoded, as it was in the early days of npm scope.

Name definition

  • Requirement: Required
  • Case Sensitive: Yes
  • Native Label: name
  • Note: The package.json spec changed in 2015 to require that a new package 'must not have uppercase letters in the name', but old packages with mixed case names were "grandfathered in".

Version definition

  • Requirement: Optional
  • Case Sensitive: Yes
  • Native Label: version

Examples

  • pkg:npm/foobar@12.3.1
  • pkg:npm/%40angular/animation@12.3.1
  • pkg:npm/mypackage@12.4.5?vcs_url=git:%2F%2Fhost.com%2F%2Fpath%2Fto%2Frepo.git%404345abcd34343