@vltpkg/spec
Classes
Spec
Defined in: index.ts:34
The base, isomorphic Spec implementation.
Extends
Implements
Constructors
new Spec()
Defined in: browser.ts:265
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
name
string
bareSpec
string
options?
Returns
Inherited from
new Spec()
Defined in: browser.ts:266
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
spec
string
options?
Returns
Inherited from
new Spec()
Defined in: browser.ts:267
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Parameters
spec
string
| Spec
bareOrOptions?
string
| SpecOptions
options?
Returns
Inherited from
Properties
bareSpec
Defined in: browser.ts:215
just the part AFTER the name, so 1.x
in [email protected]
Implementation of
Inherited from
constructor
Defined in: browser.ts:263
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Inherited from
conventionalRegistryTarball?
Defined in: browser.ts:227
conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable.
Implementation of
Inherited from
Spec
.conventionalRegistryTarball
distTag?
Defined in: browser.ts:230
a dist-tag like ‘latest’
Implementation of
Inherited from
file?
Defined in: browser.ts:232
file path for file:// url specs
Implementation of
Inherited from
gitCommittish?
Defined in: browser.ts:219
the commit value we will check out
Implementation of
Inherited from
gitRemote?
Defined in: browser.ts:216
the git remote to fetch from
Implementation of
Inherited from
gitSelector?
Defined in: browser.ts:217
the committish, semver range, and/or path portion of a git remote
Implementation of
Inherited from
gitSelectorParsed?
Defined in: browser.ts:218
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
Implementation of
Inherited from
name
Defined in: browser.ts:212
the name portion, so foo
in [email protected]
Implementation of
Inherited from
namedGitHost?
Defined in: browser.ts:220
github, gitlab, bitbucket, gist, etc.
Implementation of
Inherited from
namedGitHostPath?
Defined in: browser.ts:221
the path that’s parsed when we have a named git host
Implementation of
Inherited from
namedRegistry?
Defined in: browser.ts:224
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
Implementation of
Inherited from
options
Defined in: browser.ts:211
options passed to the constructor, plus defaults
Implementation of
Inherited from
range?
Defined in: browser.ts:229
parsed semver range specifier
Implementation of
Inherited from
registry?
Defined in: browser.ts:225
registry to consult to resolve this spec
Implementation of
Inherited from
registrySpec?
Defined in: browser.ts:226
semver range or dist-tag for resolving against a packument
Implementation of
Inherited from
remoteURL?
Defined in: browser.ts:231
URL to download a tarball from, if it can be determined.
This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.
Implementation of
Inherited from
scope?
Defined in: browser.ts:213
the name’s scope, so @acme
in @acme/[email protected]
Implementation of
Inherited from
scopeRegistry?
Defined in: browser.ts:214
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
Implementation of
Inherited from
semver?
Defined in: browser.ts:228
spec to resolve against available versions
Implementation of
Inherited from
spec
Defined in: browser.ts:210
the full named specifier passed to the constructor
Implementation of
Inherited from
subspec?
Defined in: browser.ts:233
in bar@npm:[email protected]
, this is the spec for [email protected]
Implementation of
Inherited from
type
Defined in: browser.ts:209
the type of spec that this is, ultimately
Implementation of
Inherited from
workspace?
Defined in: browser.ts:223
the package name or path of the workspace being referenced
Implementation of
Inherited from
workspaceSpec?
Defined in: browser.ts:222
the specifier when using workspace:
specs
This can be either a semver range, *
, ~
, or ^
,
if the name is not modified. Or, it can include a workspace
package name or path, like workspace:packages/foo@*
or
workspace:@scope/foo@*
.
Implementation of
Inherited from
nodejsDependencies?
Defined in: browser.ts:207
Inherited from
Accessors
final
Get Signature
Defined in: browser.ts:242
Return the final entry in the chain of subspecs When deciding which thing to actually fetch, spec.final is the thing to look at.
Returns
Implementation of
Inherited from
Methods
[kCustomInspect]()
Defined in: index.ts:35
Parameters
_depth?
number
options?
InspectOptions
Returns
string
Overrides
toString()
Defined in: browser.ts:253
Normally, the string value of a Spec is just the string passed in to
be parsed. However, in the case of a chain of subspecs, like
foo@npm:bar@npm:baz@npm:quux@latest
, this simplifies out the middle
parts of the chain, returning just foo@npm:quux@latest
Returns
string
Implementation of
Inherited from
parse()
Call Signature
Defined in: browser.ts:158
Create a Spec object from a full spec, name+bareSpec, or Spec object
Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.
Parameters
name
string
bareSpec
string
options?
Returns
Inherited from
Call Signature
Defined in: browser.ts:163
Create a Spec object from a full spec, name+bareSpec, or Spec object
Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.
Parameters
spec
string
options?
Returns
Inherited from
Call Signature
Defined in: browser.ts:164
Create a Spec object from a full spec, name+bareSpec, or Spec object
Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.
Parameters
spec
options?
Returns
Inherited from
parseArgs()
Defined in: browser.ts:175
Parameters
specOrBareSpec
string
opts?
Returns
Inherited from
parseGitSelector()
Defined in: browser.ts:628
Should only ever be called with the bit that comes AFTER the # in the git remote url.
Parameters
selector
string
spec?
Returns
[GitSelectorParsed
, string
, Range
]
Inherited from
Type Aliases
GitSelectorParsed
Defined in: types.ts:22
Type declaration
path?
semver?
Scope
Defined in: types.ts:7
SpecLike<Type>
Defined in: types.ts:133
Type declaration
final
subspec?
Type Parameters
• Type extends SpecLikeBase
SpecLikeBase
Defined in: types.ts:27
Type declaration
bareSpec
just the part AFTER the name, so 1.x
in [email protected]
conventionalRegistryTarball?
conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable.
distTag?
a dist-tag like ‘latest’
file?
file path for file:// url specs
final
getter that retrieves the actual spec value to be used
gitCommittish?
the commit value we will check out
gitRemote?
the git remote to fetch from
gitSelector?
the committish, semver range, and/or path portion of a git remote
gitSelectorParsed?
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
name
the name portion, so foo
in [email protected]
namedGitHost?
github, gitlab, bitbucket, gist, etc.
namedGitHostPath?
the path that’s parsed when we have a named git host
namedRegistry?
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
options
options passed to the constructor, plus defaults
range?
parsed semver range specifier
registry?
registry to consult to resolve this spec
registrySpec?
semver range or dist-tag for resolving against a packument
remoteURL?
URL to download a tarball from, if it can be determined.
This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.
scope?
the name’s scope, so @acme
in @acme/[email protected]
scopeRegistry?
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
semver?
spec to resolve against available versions
spec
the full named specifier passed to the constructor
subspec?
in bar@npm:[email protected]
, this is the spec for [email protected]
type
the type of spec that this is, ultimately
workspace?
the package name or path of the workspace being referenced
workspaceSpec?
the specifier when using workspace:
specs
This can be either a semver range, *
, ~
, or ^
,
if the name is not modified. Or, it can include a workspace
package name or path, like workspace:packages/foo@*
or
workspace:@scope/foo@*
.
toString()
Returns
string
SpecOptions
Defined in: types.ts:3
SpecOptionsFilled
Defined in: types.ts:9
Type declaration
git-host-archives
tarball hosting services for hosts listed in git-hosts
git-hosts
shorthand prefix names for known git hosts
registries
shorthand prefix names for known registries
registry
the registry where a spec should be resolved against
scope-registries
registries mapped to a @scope
References
defaultGitHostArchives
Re-exports defaultGitHostArchives
defaultGitHosts
Re-exports defaultGitHosts
defaultRegistries
Re-exports defaultRegistries
defaultRegistry
Re-exports defaultRegistry
defaultScopeRegistries
Re-exports defaultScopeRegistries
getOptions
Re-exports getOptions
gitHostWebsites
Re-exports gitHostWebsites
kCustomInspect
Re-exports kCustomInspect