rules/js/node/toolchain.js
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
NODE_TOOL
const NODE_TOOL
Undocumented.
nodeArtifactName()
nodeArtifactName(version, plat)
Return the Node.js release archive filename for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
nodeDownloadUrl()
nodeDownloadUrl(version, plat)
Return the Node.js release download URL for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
nodeCacheKey()
nodeCacheKey(version, plat)
Return the named-cache key for a node toolchain version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
nodeSupportedPlatforms()
nodeSupportedPlatforms()
Undocumented.
NodeToolchain (implementation class)
class NodeToolchain
Implementation class. BUILD files should use nodeToolchain().
Undocumented.
nodeToolchain()
nodeToolchain(version, opts = {})
Declare a node toolchain version and optionally set it as the default. matching lockfile entry (warns instead of failing).
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| [opts] | object | |
| [opts.default=false] | boolean | |
| [opts.unverified=false] | boolean | Allow downloading without a |
Returns: object Target handle for this node toolchain.
installNodeToolchain()
installNodeToolchain(version, source)
Install a local node toolchain directory into the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| source | string | Path to the toolchain root. |
Returns: string|null Local path to the cached toolchain root.
acquireNodeToolchain
const acquireNodeToolchain
Acquire a node toolchain, downloading and caching it if not already installed in the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string |
Returns: Promise<string> Local path to the toolchain root.
resolveNodeToolchainVersion()
resolveNodeToolchainVersion(version)
Resolve an explicit or default node toolchain version.
| Parameter | Type | Description |
|---|---|---|
| [version] | string |
Returns: string|null
defaultNodeToolchainVersion()
defaultNodeToolchainVersion()
Return the currently configured default node toolchain version.
Returns: string|null
defaultNodeToolchain()
defaultNodeToolchain()
Return the currently configured default node toolchain target handle.
Returns: object|null