NOTE: this package is still under heavy development. Please don't use it yet
pacote is a Node.js library for downloading
npm-compatible packages. It supports all package specifier
npm install and its ilk support. It transparently caches anything
needed to reduce excess operations, using
$ npm install --save pacote
const pacote =pacotepacote
The pacote team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
Fetches the manifest for a package. Manifest objects are similar and based
package.json for that package, but with pre-processed and limited
fields. The object has the following shape:
"name": PkgName"version": SemverString"dependencies": PkgName: SemverString"optionalDependencies": PkgName: SemverString"devDependencies": PkgName: SemverString"peerDependencies": PkgName: SemverString"bundleDependencies": false || PkgName"bin": BinName: Path"_resolved": TarballSource // different for each package type"_integrity": SubresourceIntegrityHash"_shrinkwrap": null || ShrinkwrapJsonObj
Note that depending on the spec type, some additional fields might be present.
For example, packages from
registry.npmjs.org have additional metadata
appended by the registry.
Extracts package data identified by
<spec> into a directory named
<destination>, which will be created if it does not already exist.
opts.digest is provided and the data it identifies is present in the cache,
extract will bypass most of its operations and go straight to extracting the
Fetches package data identified by
<spec>, usually for the purpose of warming
up the local package cache (with
opts.cache). It does not return anything.
This utility function can be used to force pacote to release its references to any memoized data in its various internal caches. It might help free some memory.
If provided, pacote will confirm that the relevant integrity hash for each
operation's results matches the given digest. The call will return
if the check fails.
pacote.extract will use this integrity string check the cache
directly for matching contents before performing any other operations.
npmlog-compatible logger. Will be used to log
various events at the levels specified by