Classes
Spec
Defined in: spec/src/browser.ts:171
The base, isomorphic Spec implementation.
Extended by
Implements
Constructors
new Spec()
new Spec( name, bareSpec, options?): SpecDefined in: spec/src/browser.ts:299
Parameters
name
string
bareSpec
string
options?
Returns
new Spec()
new Spec(spec, options?): SpecDefined in: spec/src/browser.ts:300
Parameters
spec
string
options?
Returns
new Spec()
new Spec( spec, bareOrOptions?, options?): SpecDefined in: spec/src/browser.ts:301
Parameters
spec
string | Spec
bareOrOptions?
string | SpecOptions
options?
Returns
Properties
bareSpec
bareSpec: stringDefined in: spec/src/browser.ts:238
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:257
constructor
constructor: typeof SpecDefined in: spec/src/browser.ts:297
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
conventionalRegistryTarball?
optional conventionalRegistryTarball: string;Defined in: spec/src/browser.ts:251
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:254
a dist-tag like ‘latest’
Implementation of
SpecLike.distTagfile?
optional file: string;Defined in: spec/src/browser.ts:256
file path for file:// url specs
Implementation of
SpecLike.filegitCommittish?
optional gitCommittish: string;Defined in: spec/src/browser.ts:242
the commit value we will check out
Implementation of
SpecLike.gitCommittishgitRemote?
optional gitRemote: string;Defined in: spec/src/browser.ts:239
the git remote to fetch from
Implementation of
SpecLike.gitRemotegitSelector?
optional gitSelector: string;Defined in: spec/src/browser.ts:240
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:241
the parsed ’::‘-separated key/value pairs: semver:<range> and
path:<subpath>
Implementation of
SpecLike.gitSelectorParsedname
name: stringDefined in: spec/src/browser.ts:235
the name portion, so foo in [email protected]
Implementation of
SpecLike.namenamedGitHost?
optional namedGitHost: string;Defined in: spec/src/browser.ts:243
github, gitlab, bitbucket, gist, etc.
Implementation of
SpecLike.namedGitHostnamedGitHostPath?
optional namedGitHostPath: string;Defined in: spec/src/browser.ts:244
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:248
namedRegistry?
optional namedRegistry: string;Defined in: spec/src/browser.ts:247
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:234
options passed to the constructor, plus defaults
Implementation of
SpecLike.optionsoverridden
overridden: boolean = falseDefined in: spec/src/browser.ts:259
Is this a spec that overrides another spec?
Implementation of
SpecLike.overriddenrange?
optional range: Range;Defined in: spec/src/browser.ts:253
parsed semver range specifier
Implementation of
SpecLike.rangeregistry?
optional registry: string;Defined in: spec/src/browser.ts:249
registry to consult to resolve this spec
Implementation of
SpecLike.registryregistrySpec?
optional registrySpec: string;Defined in: spec/src/browser.ts:250
semver range or dist-tag for resolving against a packument
Implementation of
SpecLike.registrySpecremoteURL?
optional remoteURL: string;Defined in: spec/src/browser.ts:255
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:236
the name’s scope, so @acme in @acme/[email protected]
Implementation of
SpecLike.scopescopeRegistry?
optional scopeRegistry: string;Defined in: spec/src/browser.ts:237
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:252
spec to resolve against available versions
Implementation of
SpecLike.semverspec
spec: stringDefined in: spec/src/browser.ts:233
the full named specifier passed to the constructor
Implementation of
SpecLike.specsubspec?
optional subspec: Spec;Defined in: spec/src/browser.ts:258
in bar@npm:[email protected], this is the spec for [email protected]
Implementation of
SpecLike.subspectype
type: SpecTypeDefined in: spec/src/browser.ts:232
the type of spec that this is, ultimately
Implementation of
SpecLike.typeworkspace?
optional workspace: string;Defined in: spec/src/browser.ts:246
the package name or path of the workspace being referenced
Implementation of
SpecLike.workspaceworkspaceSpec?
optional workspaceSpec: string;Defined in: spec/src/browser.ts:245
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:230
Accessors
final
Get Signature
get final(): Spec & objectDefined in: spec/src/browser.ts:268
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.finalinheritedRegistry
Set Signature
set inheritedRegistry(reg): voidDefined in: spec/src/browser.ts:771
Sets a registry value that should be used for this spec in case it is currently just following the default registry.
Parameters
reg
undefined | string
Returns
void
Implementation of
SpecLike.inheritedRegistryMethods
[kCustomInspect]()
kCustomInspect: stringDefined in: spec/src/browser.ts:689
Returns
string
toString()
toString(): stringDefined in: spec/src/browser.ts:287
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:178
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:183
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:184
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:195
Parameters
specOrBareSpec
string
opts?
Returns
parseGitSelector()
static parseGitSelector(selector, spec?): [GitSelectorParsed, string, Range]Defined in: spec/src/browser.ts:785
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:148
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:33
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:26
Type declaration
bitbucket
gist
github
gitlab
defaultJsrRegistries
const defaultJsrRegistries: objectDefined in: spec/src/browser.ts:24
Type declaration
jsr
jsr: string = 'https://npm.jsr.io/'defaultRegistries
const defaultRegistries: objectDefined in: spec/src/browser.ts:19
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
defaultScopeRegistries
const defaultScopeRegistries: objectDefined in: spec/src/browser.ts:56
Type declaration
@jsr
@jsr: string = 'https://npm.jsr.io/';gitHostWebsites
const gitHostWebsites: objectDefined in: spec/src/browser.ts:49
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
getNormalizeFile()
function getNormalizeFile(opts?): (bareSpec, spec) => [string, string]Defined in: spec/src/browser.ts:861
Parameters
opts?
Returns
Function
Parameters
bareSpec
string
spec
Returns
[string, string]
getOptions()
function getOptions(options?): SpecOptionsFilledDefined in: spec/src/browser.ts:60
Parameters
options?
Returns
isSpec()
function isSpec(spec): spec is SpecDefined in: spec/src/browser.ts:156
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