Documentation
¶
Index ¶
- func InstallFromLockfile(lf *Lockfile, nodeModulesDir string) error
- func ParsePackageSpec(spec string) (name, version string)
- func ResolveAndInstall(specs []string, nodeModulesDir string) (map[string]*ResolvedPackage, error)
- func WriteLockfile(path string, lf *Lockfile) error
- type Lockfile
- type LockfileEntry
- type ResolvedPackage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallFromLockfile ¶
InstallFromLockfile downloads packages from a lockfile without re-resolving.
func ParsePackageSpec ¶
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 ¶
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 ¶
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.