Skip to main content

Module npm_native

Module npm_native 

Source
Expand description

Native npm registry plugin.

Extracts the authoritative package name + version from the package/package.json inside an npm .tgz tarball — not from the filename. This matters for scoped packages: a registry tarball for @scope/pkg is served as …/-/pkg-1.2.3.tgz, i.e. the scope is dropped from the filename. Only package.json carries the real "name": "@scope/pkg". Parsing it (under the host-decompressors feature, via lgz’s gzip+tar filter) is what lets the read-side NpmView resolve scoped coords correctly.

When host-decompressors is off (or the tarball can’t be parsed), the plugin falls back to a best-effort (name, version) split from the filename — never panics, always returns a row.

Structs§

NpmPlugin
Native npm plugin. name/version come from package.json when the tarball is decompressable, else from the filename.