Classes
Spec
Defined in: spec/src/browser.ts:196
The base, isomorphic Spec implementation.
Extended by
Implements
Constructors
new Spec()
new Spec( name, bareSpec, options?): SpecDefined in: spec/src/browser.ts:324
Parameters
name
string
bareSpec
string
options?
Returns
new Spec()
new Spec(spec, options?): SpecDefined in: spec/src/browser.ts:325
Parameters
spec
string
options?
Returns
new Spec()
new Spec( spec, bareOrOptions?, options?): SpecDefined in: spec/src/browser.ts:326
Parameters
spec
string | Spec
bareOrOptions?
string | SpecOptions
options?
Returns
Properties
bareSpec
bareSpec: stringDefined in: spec/src/browser.ts:263
just the part AFTER the name, so 1.x in [email protected]
Implementation of
SpecLike.bareSpeccatalog?
optional catalog: string;Defined in: spec/src/browser.ts:282
constructor
constructor: typeof SpecDefined in: spec/src/browser.ts:322
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
conventionalRegistryTarball?
optional conventionalRegistryTarball: string;Defined in: spec/src/browser.ts:276
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.conventionalRegistryTarballdistTag?
optional distTag: string;Defined in: spec/src/browser.ts:279
a dist-tag like ‘latest’
Implementation of
SpecLike.distTagfile?
optional file: string;Defined in: spec/src/browser.ts:281
file path for file:// url specs
Implementation of
SpecLike.filegitCommittish?
optional gitCommittish: string;Defined in: spec/src/browser.ts:267
the commit value we will check out
Implementation of
SpecLike.gitCommittishgitRemote?
optional gitRemote: string;Defined in: spec/src/browser.ts:264
the git remote to fetch from
Implementation of
SpecLike.gitRemotegitSelector?
optional gitSelector: string;Defined in: spec/src/browser.ts:265
the committish, semver range, and/or path portion of a git remote
Implementation of
SpecLike.gitSelectorgitSelectorParsed?
optional gitSelectorParsed: GitSelectorParsed;Defined in: spec/src/browser.ts:266
the parsed ’::‘-separated key/value pairs: semver:<range> and
path:<subpath>
Implementation of
SpecLike.gitSelectorParsedname
name: stringDefined in: spec/src/browser.ts:260
the name portion, so foo in [email protected]
Implementation of
SpecLike.namenamedGitHost?
optional namedGitHost: string;Defined in: spec/src/browser.ts:268
github, gitlab, bitbucket, gist, etc.
Implementation of
SpecLike.namedGitHostnamedGitHostPath?
optional namedGitHostPath: string;Defined in: spec/src/browser.ts:269
the path that’s parsed when we have a named git host
Implementation of
SpecLike.namedGitHostPathnamedJsrRegistry?
optional namedJsrRegistry: string;Defined in: spec/src/browser.ts:273
namedRegistry?
optional namedRegistry: string;Defined in: spec/src/browser.ts:272
In specs like foo@npm:bar@1, this is the ‘npm’ part. Other
registries can be mapped using the registries option.
Implementation of
SpecLike.namedRegistryoptions
options: SpecOptionsFilledDefined in: spec/src/browser.ts:259
options passed to the constructor, plus defaults
Implementation of
SpecLike.optionsoverridden
overridden: boolean = falseDefined in: spec/src/browser.ts:284
Is this a spec that overrides another spec?
Implementation of
SpecLike.overriddenrange?
optional range: Range;Defined in: spec/src/browser.ts:278
parsed semver range specifier
Implementation of
SpecLike.rangeregistry?
optional registry: string;Defined in: spec/src/browser.ts:274
registry to consult to resolve this spec
Implementation of
SpecLike.registryregistrySpec?
optional registrySpec: string;Defined in: spec/src/browser.ts:275
semver range or dist-tag for resolving against a packument
Implementation of
SpecLike.registrySpecremoteURL?
optional remoteURL: string;Defined in: spec/src/browser.ts:280
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.remoteURLscope?
optional scope: `@${string}`;Defined in: spec/src/browser.ts:261
the name’s scope, so @acme in @acme/[email protected]
Implementation of
SpecLike.scopescopeRegistry?
optional scopeRegistry: string;Defined in: spec/src/browser.ts:262
if the name is scoped, and there’s a registry associated with the scope, then this is that registry
Implementation of
SpecLike.scopeRegistrysemver?
optional semver: string;Defined in: spec/src/browser.ts:277
spec to resolve against available versions
Implementation of
SpecLike.semverspec
spec: stringDefined in: spec/src/browser.ts:258
the full named specifier passed to the constructor
Implementation of
SpecLike.specsubspec?
optional subspec: Spec;Defined in: spec/src/browser.ts:283
in bar@npm:[email protected], this is the spec for [email protected]
Implementation of
SpecLike.subspectype
type: SpecTypeDefined in: spec/src/browser.ts:257
the type of spec that this is, ultimately
Implementation of
SpecLike.typeworkspace?
optional workspace: string;Defined in: spec/src/browser.ts:271
the package name or path of the workspace being referenced
Implementation of
SpecLike.workspaceworkspaceSpec?
optional workspaceSpec: string;Defined in: spec/src/browser.ts:270
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.workspaceSpecnodejsDependencies?
static optional nodejsDependencies: NodeJSDependenciesOptions;Defined in: spec/src/browser.ts:255
Accessors
final
Get Signature
get final(): Spec & objectDefined in: spec/src/browser.ts:293
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
Spec & object
Implementation of
SpecLike.finalMethods
[kCustomInspect]()
kCustomInspect: stringDefined in: spec/src/browser.ts:710
Returns
string
toString()
toString(): stringDefined in: spec/src/browser.ts:312
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
SpecLike.toStringparse()
Call Signature
static parse( name, bareSpec, options?): SpecDefined in: spec/src/browser.ts:203
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
Call Signature
static parse(spec, options?): SpecDefined in: spec/src/browser.ts:208
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
Call Signature
static parse(spec, options?): SpecDefined in: spec/src/browser.ts:209
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
parseArgs()
static parseArgs(specOrBareSpec, opts?): SpecDefined in: spec/src/browser.ts:220
Parameters
specOrBareSpec
string
opts?
Returns
parseGitSelector()
static parseGitSelector(selector, spec?): [GitSelectorParsed, string, Range]Defined in: spec/src/browser.ts:792
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]
Type Aliases
NodeJSDependenciesOptions
type NodeJSDependenciesOptions = objectDefined in: spec/src/browser.ts:153
Injects the Node.js dependencies into the Spec class.
Type declaration
homedir
homedir: homedirisAbsolute
isAbsolute: isAbsolutejoin
join: joinresolve
resolve: resolvewinPath
winPath: win32Variables
defaultGitHostArchives
const defaultGitHostArchives: objectDefined in: spec/src/browser.ts:34
Type declaration
bitbucket
bitbucket: string = 'https://bitbucket.org/$1/$2/get/$committish.tar.gz'gist
gist: string = 'https://codeload.github.com/gist/$1/tar.gz/$committish'github
github: string = 'https://api.github.com/repos/$1/$2/tarball/$committish'gitlab
gitlab: string = 'https://gitlab.com/$1/$2/repository/archive.tar.gz?ref=$committish'defaultGitHosts
const defaultGitHosts: objectDefined in: spec/src/browser.ts:27
Type declaration
bitbucket
gist
github
gitlab
defaultJsrRegistries
const defaultJsrRegistries: objectDefined in: spec/src/browser.ts:25
Type declaration
jsr
jsr: string = 'https://npm.jsr.io/'defaultRegistries
const defaultRegistries: objectDefined in: spec/src/browser.ts:20
Type declaration
gh
gh: string = 'https://npm.pkg.github.com/'npm
npm: string = defaultRegistrydefaultRegistry
const defaultRegistry: 'https://registry.npmjs.org/' = 'https://registry.npmjs.org/'Defined in: spec/src/browser.ts:17
defaultRegistryName
const defaultRegistryName: 'npm' = 'npm'Defined in: spec/src/browser.ts:18
defaultScopeRegistries
const defaultScopeRegistries: objectDefined in: spec/src/browser.ts:57
Type declaration
@jsr
@jsr: string = 'https://npm.jsr.io/';gitHostWebsites
const gitHostWebsites: objectDefined in: spec/src/browser.ts:50
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
bitbucket: string = 'https://bitbucket.org/'gist
gist: string = 'https://gist.github.com/'github
github: string = 'https://github.com/'gitlab
gitlab: string = 'https://gitlab.com/'kCustomInspect
const kCustomInspect: typeof kCustomInspectDefined in: spec/src/browser.ts:15
Functions
currentDefaultRegistryName()
function currentDefaultRegistryName( registry, options,): undefined | stringDefined in: spec/src/browser.ts:177
Retrieves the short configured name of the default registry if one is available.
Parameters
registry
string
options
Returns
undefined | string
getNormalizeFile()
function getNormalizeFile(opts?): (bareSpec, spec) => [string, string]Defined in: spec/src/browser.ts:868
Parameters
opts?
Returns
Function
Parameters
bareSpec
string
spec
Returns
[string, string]
getOptions()
function getOptions(options?): SpecOptionsFilledDefined in: spec/src/browser.ts:61
Parameters
options?
Returns
isSpec()
function isSpec(spec): spec is SpecDefined in: spec/src/browser.ts:161
Parameters
spec
unknown
Returns
spec is 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
SpecType
Re-exports SpecType