summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/README.md
diff options
context:
space:
mode:
authorKat Marchán <kzm@zkat.tech>2019-01-29 14:43:00 -0800
committerMyles Borins <mylesborins@google.com>2019-02-12 00:06:29 -0800
commit43dd49c9782848c25e5b03448c8a0f923f13c158 (patch)
treef7ac5d645019b2b844f26be66c291bbae734d097 /deps/npm/node_modules/pacote/README.md
parentb361f9577fbd72e518438d3fa0b01f7d34d814a5 (diff)
downloadandroid-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.tar.gz
android-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.tar.bz2
android-node-v8-43dd49c9782848c25e5b03448c8a0f923f13c158.zip
deps: upgrade npm to 6.7.0
PR-URL: https://github.com/nodejs/node/pull/25804 Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/pacote/README.md')
-rw-r--r--deps/npm/node_modules/pacote/README.md127
1 files changed, 107 insertions, 20 deletions
diff --git a/deps/npm/node_modules/pacote/README.md b/deps/npm/node_modules/pacote/README.md
index 5c9985549d..8d160b7cb7 100644
--- a/deps/npm/node_modules/pacote/README.md
+++ b/deps/npm/node_modules/pacote/README.md
@@ -16,13 +16,14 @@ needed to reduce excess operations, using [`cacache`](https://npm.im/cacache).
* [Contributing](#contributing)
* [API](#api)
* [`manifest`](#manifest)
+ * [`packument`](#packument)
* [`extract`](#extract)
* [`tarball`](#tarball)
* [`tarball.stream`](#tarball-stream)
* [`tarball.toFile`](#tarball-to-file)
- * [`prefetch`](#prefetch)
- * [`options`](#options)
+ * ~~[`prefetch`](#prefetch)~~ (deprecated)
* [`clearMemoized`](#clearMemoized)
+ * [`options`](#options)
### Example
@@ -88,6 +89,43 @@ pacote.manifest('pacote@1.0.0').then(pkgJson => {
})
```
+#### <a name="packument"></a> `> 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:
+
+```javascript
+{
+ "name": PkgName,
+ "dist-tags": {
+ 'latest': VersionString,
+ [TagName]: VersionString,
+ ...
+ },
+ "versions": {
+ [VersionString]: Manifest,
+ ...
+ }
+}
+```
+
+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
+
+```javascript
+pacote.packument('pacote').then(pkgJson => {
+ // fetched package versions metadata from the registry
+})
+```
+
#### <a name="extract"></a> `> pacote.extract(spec, destination, [opts])`
Extracts package data identified by `<spec>` into a directory named
@@ -176,26 +214,75 @@ pacote.manifest(...).then(() => pacote.clearMemoized)
#### <a name="options"></a> `> options`
-##### `opts.integrity`
+`pacote` accepts [the options for
+`npm-registry-fetch`](https://npm.im/npm-registry-fetch#fetch-options) as-is,
+with a couple of additional `pacote-specific` ones:
+
+##### <a name="dirPacker"></a> `opts.dirPacker`
+
+* Type: Function
+* Default: Uses [`npm-packlist`](https://npm.im/npm-packlist) and [`tar`](https://npm.im/tar) 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.
+
+##### <a name="opts-enjoy-by"></a> `opts.enjoy-by`
+
+* Alias: `opts.enjoyBy`
+* 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.
+
+##### <a name="opts-include-deprecated"></a> `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.
+
+##### <a name="opts-full-metadata"></a> `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".
+
+##### <a name="opts-tag"></a> `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`](https://npm.im/npm-pick-manifest).
+
+##### <a name="opts-resolved"></a> `opts.resolved`
-If provided, pacote will confirm that the relevant integrity hash for each
-operation's results matches the given digest. The call will return `EINTEGRITY`
-if the check fails.
+* Type: String
+* Default: null
-Additionally, `pacote.extract` will use this integrity string check the cache
-directly for matching contents before performing any other operations.
+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.cache`
-##### `opts.cacheUid`/`opts.cacheGid`
-##### `opts.uid`/`opts.gid`
-##### `opts.scope`
-##### `opts.registry`
-##### `opts.@somescope:registry`
-##### `opts.auth`
-##### `opts.log`
-##### `opts.maxSockets`
+##### <a name="opts-where"></a> `opts.where`
-Default: `silentNpmLog`
+* Type: String
+* Default: null
-An [`npmlog`](https://npm.im/npmlog)-compatible logger. Will be used to log
-various events at the levels specified by `npmlog`.
+Passed as an argument to [`npm-package-arg`](https://npm.im/npm-package-arg)
+when resolving `spec` arguments. Used to determine what path to resolve local
+path specs relatively from.