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.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

nodeDownloadUrl()

nodeDownloadUrl(version, plat)

Return the Node.js release download URL for a version and platform.

ParameterTypeDescription
versionstring
plat{ os: string, arch: string }

Returns: string

nodeCacheKey()

nodeCacheKey(version, plat)

Return the named-cache key for a node toolchain version and platform.

ParameterTypeDescription
versionstring
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).

ParameterTypeDescription
versionstring
[opts]object
[opts.default=false]boolean
[opts.unverified=false]booleanAllow 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.

ParameterTypeDescription
versionstring
sourcestringPath 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.

ParameterTypeDescription
versionstring

Returns: Promise<string> Local path to the toolchain root.

resolveNodeToolchainVersion()

resolveNodeToolchainVersion(version)

Resolve an explicit or default node toolchain version.

ParameterTypeDescription
[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