Installations
npm install @evocateur/pacote
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.16.0
NPM Version
6.10.3
Score
66.5
Supply Chain
96.1
Quality
68.2
Maintenance
50
Vulnerability
97.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
evocateur
Download Statistics
Total Downloads
112,331,193
Last Day
15,370
Last Week
66,117
Last Month
345,645
Last Year
5,854,023
GitHub Statistics
656 Commits
1 Forks
1 Watching
1 Branches
1 Contributors
Bundle Size
812.92 kB
Minified
322.36 kB
Minified + Gzipped
Package Meta Information
Latest Version
9.6.5
Package Id
@evocateur/pacote@9.6.5
Size
32.26 kB
NPM Version
6.10.3
Node Version
10.16.0
Publised On
20 Aug 2019
Total Downloads
Cumulative downloads
Total Downloads
112,331,193
Last day
-8.1%
15,370
Compared to previous day
Last week
-23.6%
66,117
Compared to previous week
Last month
3%
345,645
Compared to previous month
Last year
-33.9%
5,854,023
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
29
@evocatur/pacote
NOTE: This is a fork of https://github.com/npm/pacote and you probably don't want to use it.
pacote
is a Node.js library for downloading
npm-compatible packages. It supports all package specifier
syntax that npm install
and its ilk support. It transparently caches anything
needed to reduce excess operations, using cacache
.
Install
$ npm install --save pacote
Table of Contents
Example
1const pacote = require('pacote') 2 3pacote.manifest('pacote@^1').then(pkg => { 4 console.log('package manifest for registry pkg:', pkg) 5 // { "name": "pacote", "version": "1.0.0", ... } 6}) 7 8pacote.extract('http://hi.com/pkg.tgz', './here').then(() => { 9 console.log('remote tarball contents extracted to ./here') 10})
Features
- Handles all package types npm does
- high-performance, reliable, verified local cache
- offline mode
- authentication support (private git, private npm registries, etc)
- github, gitlab, and bitbucket-aware
- semver range support for git dependencies
Contributing
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.
API
> pacote.manifest(spec, [opts])
Fetches the manifest for a package. Manifest objects are similar and based
on the package.json
for that package, but with pre-processed and limited
fields. The object has the following shape:
1{ 2 "name": PkgName, 3 "version": SemverString, 4 "dependencies": { PkgName: SemverString }, 5 "optionalDependencies": { PkgName: SemverString }, 6 "devDependencies": { PkgName: SemverString }, 7 "peerDependencies": { PkgName: SemverString }, 8 "bundleDependencies": false || [PkgName], 9 "bin": { BinName: Path }, 10 "_resolved": TarballSource, // different for each package type 11 "_integrity": SubresourceIntegrityHash, 12 "_shrinkwrap": null || ShrinkwrapJsonObj 13}
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.
Example
1pacote.manifest('pacote@1.0.0').then(pkgJson => { 2 // fetched `package.json` data from the registry 3})
> pacote.packument(spec, [opts])
Fetches the packument for a package. Packument objects are general metadata
about a project corresponding to registry metadata, and include version and
dist-tag
information about a package's available versions, rather than a
specific version. It may include additional metadata not usually available
through the individual package metadata objects.
It generally looks something like this:
1{ 2 "name": PkgName, 3 "dist-tags": { 4 'latest': VersionString, 5 [TagName]: VersionString, 6 ... 7 }, 8 "versions": { 9 [VersionString]: Manifest, 10 ... 11 } 12}
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.
Example
1pacote.packument('pacote').then(pkgJson => { 2 // fetched package versions metadata from the registry 3})
> pacote.extract(spec, destination, [opts])
Extracts package data identified by <spec>
into a directory named
<destination>
, which will be created if it does not already exist.
If 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
tarball.
Example
1pacote.extract('pacote@1.0.0', './woot', { 2 digest: 'deadbeef' 3}).then(() => { 4 // Succeeds as long as `pacote@1.0.0` still exists somewhere. Network and 5 // other operations are bypassed entirely if `digest` is present in the cache. 6})
> pacote.tarball(spec, [opts])
Fetches package data identified by <spec>
and returns the data as a buffer.
This API has two variants:
pacote.tarball.stream(spec, [opts])
- Same aspacote.tarball
, except it returns a stream instead of a Promise.pacote.tarball.toFile(spec, dest, [opts])
- Instead of returning data directly, data will be written directly todest
, and create any required directories along the way.
Example
1pacote.tarball('pacote@1.0.0', { cache: './my-cache' }).then(data => { 2 // data is the tarball data for pacote@1.0.0 3})
> pacote.tarball.stream(spec, [opts])
Same as pacote.tarball
, except it returns a stream instead of a Promise.
Example
1pacote.tarball.stream('pacote@1.0.0') 2.pipe(fs.createWriteStream('./pacote-1.0.0.tgz'))
> pacote.tarball.toFile(spec, dest, [opts])
Like pacote.tarball
, but instead of returning data directly, data will be
written directly to dest
, and create any required directories along the way.
Example
1pacote.tarball.toFile('pacote@1.0.0', './pacote-1.0.0.tgz') 2.then(() => /* pacote tarball written directly to ./pacote-1.0.0.tgz */)
> pacote.prefetch(spec, [opts])
THIS API IS DEPRECATED. USE pacote.tarball()
INSTEAD
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.
Example
1pacote.prefetch('pacote@1.0.0', { cache: './my-cache' }).then(() => { 2 // ./my-cache now has both the manifest and tarball for `pacote@1.0.0`. 3})
> pacote.clearMemoized()
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.
1pacote.manifest(...).then(() => pacote.clearMemoized) 2
> options
pacote
accepts the options for
npm-registry-fetch
as-is,
with a couple of additional pacote-specific
ones:
opts.dirPacker
- Type: Function
- Default: Uses
npm-packlist
andtar
to make a tarball.
Expects a function that takes a single argument, dir
, and returns a
ReadableStream
that outputs packaged tarball data. Used when creating tarballs
for package specs that are not already packaged, such as git and directory
dependencies. The default opts.dirPacker
does not execute prepare
scripts,
even though npm itself does.
opts.enjoy-by
- Alias:
opts.enjoyBy
,opts.before
- Type: Date-able
- Default: undefined
If passed in, will be used while resolving to filter the versions for registry
dependencies such that versions published after opts.enjoy-by
are not
considered -- as if they'd never been published.
opts.include-deprecated
- Alias:
opts.includeDeprecated
- Type: Boolean
- Default: false
If false, deprecated versions will be skipped when selecting from registry range specifiers. If true, deprecations do not affect version selection.
opts.full-metadata
- Type: Boolean
- Default: false
If true
, the full packument will be fetched when doing metadata requests. By
defaul, pacote
only fetches the summarized packuments, also called "corgis".
opts.tag
- Alias:
opts.defaultTag
- Type: String
- Default:
'latest'
Package version resolution tag. When processing registry spec ranges, this
option is used to determine what dist-tag to treat as "latest". For more details
about how pacote
selects versions and how tag
is involved, see the
documentation for npm-pick-manifest
.
opts.resolved
- Type: String
- Default: null
When fetching tarballs, this option can be passed in to skip registry metadata
lookups when downloading tarballs. If the string is a file:
URL, pacote will
try to read the referenced local file before attempting to do any further
lookups. This option does not bypass integrity checks when opts.integrity
is
passed in.
opts.where
- Type: String
- Default: null
Passed as an argument to npm-package-arg
when resolving spec
arguments. Used to determine what path to resolve local
path specs relatively from.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'latest'
Reason
51 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More