registry

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallFromLockfile

func InstallFromLockfile(lf *Lockfile, nodeModulesDir string) error

InstallFromLockfile downloads packages from a lockfile without re-resolving.

func ParsePackageSpec

func ParsePackageSpec(spec string) (name, version string)

ParsePackageSpec splits "lodash@4" into ("lodash", "4"). Scoped packages like "@scope/pkg@1" are handled correctly.

func ResolveAndInstall

func ResolveAndInstall(specs []string, nodeModulesDir string) (map[string]*ResolvedPackage, error)

ResolveAndInstall resolves all packages and their dependencies, then downloads them in parallel to nodeModulesDir.

func WriteLockfile

func WriteLockfile(path string, lf *Lockfile) error

WriteLockfile writes a ramune.lock file.

Types

type Lockfile

type Lockfile struct {
	Version  int                      `json:"version"`
	Packages map[string]LockfileEntry `json:"packages"`
}

Lockfile represents the ramune.lock file for reproducible installs.

func LockfileFromResolved

func LockfileFromResolved(resolved map[string]*ResolvedPackage) *Lockfile

LockfileFromResolved creates a Lockfile from resolved packages.

func ReadLockfile

func ReadLockfile(path string) (*Lockfile, error)

ReadLockfile reads a ramune.lock file. Returns nil if the file does not exist.

type LockfileEntry

type LockfileEntry struct {
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Integrity    string            `json:"integrity"`
	Tarball      string            `json:"tarball"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
}

LockfileEntry is a single locked package.

type ResolvedPackage

type ResolvedPackage struct {
	Name         string
	Version      string
	Integrity    string
	Tarball      string
	Dependencies map[string]string
}

ResolvedPackage is the result of resolving a package name + version range.

func ResolvePackage

func ResolvePackage(name, versionRange string) (*ResolvedPackage, error)

ResolvePackage resolves a package name and version range to a specific version.

Jump to

Keyboard shortcuts

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