browser | @vltpkg/spec
References
GitSelectorParsed
Re-exports GitSelectorParsed
Scope
Re-exports Scope
SpecLike
Re-exports SpecLike
SpecLikeBase
Re-exports SpecLikeBase
SpecOptions
Re-exports SpecOptions
SpecOptionsFilled
Re-exports SpecOptionsFilled
Classes
Spec
The base, isomorphic Spec implementation.
Extended by
Implements
Constructors
new Spec()
Parameters
• name: string
• bareSpec: string
• options?: SpecOptions
Returns
Defined in
browser.ts:265
new Spec()
Parameters
• spec: string
• options?: SpecOptions
Returns
Defined in
browser.ts:266
new Spec()
Parameters
• spec: string
| Spec
• bareOrOptions?: string
| SpecOptions
• options?: SpecOptions
Returns
Defined in
browser.ts:267
Properties
bareSpec
just the part AFTER the name, so 1.x
in [email protected]
Implementation of
SpecLike.bareSpec
Defined in
browser.ts:215
constructor
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Defined in
browser.ts:263
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.
Implementation of
SpecLike.conventionalRegistryTarball
Defined in
browser.ts:227
distTag?
a dist-tag like ‘latest’
Implementation of
SpecLike.distTag
Defined in
browser.ts:230
file?
file path for file:// url specs
Implementation of
SpecLike.file
Defined in
browser.ts:232
gitCommittish?
the commit value we will check out
Implementation of
SpecLike.gitCommittish
Defined in
browser.ts:219
gitRemote?
the git remote to fetch from
Implementation of
SpecLike.gitRemote
Defined in
browser.ts:216
gitSelector?
the committish, semver range, and/or path portion of a git remote
Implementation of
SpecLike.gitSelector
Defined in
browser.ts:217
gitSelectorParsed?
the parsed ’::‘-separated key/value pairs:
semver:<range>
and path:<subpath>
Implementation of
SpecLike.gitSelectorParsed
Defined in
browser.ts:218
name
the name portion, so foo
in [email protected]
Implementation of
SpecLike.name
Defined in
browser.ts:212
namedGitHost?
github, gitlab, bitbucket, gist, etc.
Implementation of
SpecLike.namedGitHost
Defined in
browser.ts:220
namedGitHostPath?
the path that’s parsed when we have a named git host
Implementation of
SpecLike.namedGitHostPath
Defined in
browser.ts:221
namedRegistry?
In specs like foo@npm:bar@1
, this is the ‘npm’ part. Other
registries can be mapped using the registries
option.
Implementation of
SpecLike.namedRegistry
Defined in
browser.ts:224
options
options passed to the constructor, plus defaults
Implementation of
SpecLike.options
Defined in
browser.ts:211
range?
parsed semver range specifier
Implementation of
SpecLike.range
Defined in
browser.ts:229
registry?
registry to consult to resolve this spec
Implementation of
SpecLike.registry
Defined in
browser.ts:225
registrySpec?
semver range or dist-tag for resolving against a packument
Implementation of
SpecLike.registrySpec
Defined in
browser.ts:226
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.
Implementation of
SpecLike.remoteURL
Defined in
browser.ts:231
scope?
the name’s scope, so @acme
in @acme/[email protected]
Implementation of
SpecLike.scope
Defined in
browser.ts:213
scopeRegistry?
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
Implementation of
SpecLike.scopeRegistry
Defined in
browser.ts:214
semver?
spec to resolve against available versions
Implementation of
SpecLike.semver
Defined in
browser.ts:228
spec
the full named specifier passed to the constructor
Implementation of
SpecLike.spec
Defined in
browser.ts:210
subspec?
in bar@npm:[email protected]
, this is the spec for [email protected]
Implementation of
SpecLike.subspec
Defined in
browser.ts:233
type
the type of spec that this is, ultimately
Implementation of
SpecLike.type
Defined in
browser.ts:209
workspace?
the package name or path of the workspace being referenced
Implementation of
SpecLike.workspace
Defined in
browser.ts:223
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@*
.
Implementation of
SpecLike.workspaceSpec
Defined in
browser.ts:222
nodejsDependencies?
Defined in
browser.ts:207
Accessors
final
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
SpecLike.final
Defined in
browser.ts:242
Methods
[kCustomInspect]()
Returns
string
Defined in
browser.ts:577
toString()
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
Defined in
browser.ts:253
parse()
parse(name, bareSpec, options)
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?: SpecOptions
Returns
Defined in
browser.ts:158
parse(spec, options)
Parameters
• spec: string
• options?: SpecOptions
Returns
Defined in
browser.ts:163
parse(spec, options)
Parameters
• spec: Spec
• options?: SpecOptions
Returns
Defined in
browser.ts:164
parseArgs()
Parameters
• specOrBareSpec: string
• opts?: SpecOptions
Returns
Defined in
browser.ts:175
parseGitSelector()
Should only ever be called with the bit that comes AFTER the # in the git remote url.
Parameters
• selector: string
• spec?: Spec
Returns
[GitSelectorParsed
, string
, Range
]
Defined in
browser.ts:628
Type Aliases
NodeJSDependenciesOptions
Injects the Node.js dependencies into the Spec class.
Type declaration
homedir
isAbsolute
join
resolve
winPath
Defined in
browser.ts:140
Variables
defaultGitHostArchives
Type declaration
bitbucket
gist
github
gitlab
Defined in
browser.ts:31
defaultGitHosts
Type declaration
bitbucket
gist
github
gitlab
Defined in
browser.ts:24
defaultRegistries
Type declaration
npm
Defined in
browser.ts:20
defaultRegistry
Defined in
browser.ts:18
defaultScopeRegistries
Defined in
browser.ts:54
gitHostWebsites
These are just for legacy support of urls that are supported by npm and observed in the wild.
Not configurable, because no more will be added. If you wish to define
custom git hosts, use it with the 'git-hosts'
and 'git-host-archives'
options.
Type declaration
bitbucket
gist
github
gitlab
Defined in
browser.ts:47
kCustomInspect
Defined in
browser.ts:16
Functions
getNormalizeFile()
Parameters
• opts?: NodeJSDependenciesOptions
Returns
Function
Parameters
• bareSpec: string
• spec: Spec
Returns
[string
, string
]
Defined in
browser.ts:704
getOptions()
Parameters
• options?: SpecOptions
Returns
Defined in
browser.ts:56