npm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package npm builds and publishes platform-specific npm packages wrapping Go binaries. It delegates publishing to the npm CLI via os/exec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(ctx context.Context, cfg *Config) error

Publish builds platform npm packages and a root coordinator package, then publishes all of them via `npm publish`.

Types

type Artifact

type Artifact struct {
	GOOS          string
	GOARCH        string
	Path          string
	NpmOS         string // e.g. "linux"
	NpmCPU        string // e.g. "x64"
	PackageSuffix string // e.g. "linux-x64"
}

Artifact is a resolved binary file path for one os/arch pair.

type Config

type Config struct {
	Name       string
	Version    string
	Summary    string
	License    string
	Artifacts  []Artifact
	DryRun     bool
	Org        string
	Tag        string
	Provenance bool
	ReadmePath string
	Repository string
	Stdout     io.Writer
}

Config parameterizes an npm publish run.

Jump to

Keyboard shortcuts

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