node

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 13 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) 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) 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