Documentation
¶
Overview ¶
Package pkgs finds the npm or PyPI package an npx or uvx tool runs, and pins it to an exact version.
`npx -y some-server` runs whatever was published last, every time the agent starts it, with the tool's secrets in its environment. A compromised or broken release would reach you without you doing anything. Pinned, a tool only changes when you run `toolshed upgrade`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNothingToPin = errors.New("nothing to pin")
ErrNothingToPin is returned by PinLatest for entries without a package, or whose package is already pinned to an exact version.
var Timeout = 10 * time.Second
Timeout bounds one version lookup.
Functions ¶
Types ¶
type Ref ¶
type Ref struct {
Kind string // registry.KindNPX or registry.KindUVX
Name string // npm or PyPI package name
Version string // what it's pinned to; "" when it isn't
Exact bool // Version is one exact release (not a range or tag)
// contains filtered or unexported fields
}
Ref is the package an npx or uvx entry runs.
func Find ¶
Find returns the package an entry runs. ok is false for anything that isn't an npx or uvx entry with a registry package (a git URL, a local path, or flags toolshed doesn't know, since it then can't tell which argument is the package).