Help us shape the future of Go! Take the 2026 Go Developer Survey

node

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package node resolves Node.js runtime versions from nodejs.org's public, unauthenticated release index. The index lists every release newest-first in a single response, so discovery is one fetch with no pagination; each candidate carries the release date the index supplies. By default it tracks all releases; lts restricts to the long-term-support lines. Checksums are left to a follower reading the version's predictable SHASUMS256.txt file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider)

Option configures a Provider.

func WithTransport

func WithTransport(rt http.RoundTripper) Option

WithTransport overrides the HTTP transport, for tests.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider resolves Node.js runtime versions from nodejs.org's public, unauthenticated release index. The index is a single newest-first JSON listing of every release, so the provider fetches it once and lets the framework own selection; it only lists candidates and tags each with the release date the index returns for free.

func New

func New(opts ...Option) *Provider

New returns the Node.js provider. The release index is public and publishes no rate-limit headers, so the client is a plain cached one with no ratelimit wrapper or credentials.

func (*Provider) BareMajor added in v0.4.0

func (p *Provider) BareMajor()

BareMajor marks a bare single-number pin as major-precision rather than a calendar tag: nodejs.org publishes vX.Y.Z runtimes, never a calendar stamp, so a dotted candidate may replace one.

func (*Provider) Color added in v0.3.10

func (p *Provider) Color(dark bool) color.Color

Color is the provider's brand color. See provider.Provider.Color.

func (*Provider) Dated added in v0.2.8

func (p *Provider) Dated()

Dated marks the listing as date-bearing: every release carries a publication date, so cooldown applies.

func (*Provider) Describe

func (p *Provider) Describe(r provider.Resource) string

Describe returns a human-readable label for a resource, noting when it is scoped to the LTS lines.

func (*Provider) Discover

func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)

Discover lists candidate Node.js versions, reading the release index in one fetch. The index holds the whole release history newest-first in a single response, so there is no pagination and nothing is ever left unread - --deep has no work to do here.

func (*Provider) Identify added in v0.3.10

func (p *Provider) Identify(r provider.Resource) (string, string)

Identify names the Node.js runtime and its home page.

func (*Provider) Keys

func (p *Provider) Keys() []provider.Key

Keys reports the directive keys node accepts, in canonical order.

func (*Provider) Name

func (p *Provider) Name() string

Name identifies the provider.

func (*Provider) Resource

func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)

Resource validates a directive into a Node.js resource.

func (*Provider) URL

URL builds the web page for a resolved candidate: the version's artifact directory on nodejs.org. It links via the upstream ref, which keeps the v-prefix the dist path requires - the current-version candidate carries the bare on-line value in Version but the v-prefixed form in Ref. Empty when the version is unknown.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL