Versions in this module Expand all Collapse all v1 v1.20220526.1 May 26, 2022 v1.20220523.1 May 23, 2022 Changes in this version + func Fetch(ctx context.Context, url, algorithm, hash, filename string) error + func FilenameFromURL(url string) (string, error) + func Locate(dir string) (string, error) + func PackageJSONReplaceDependencies(packageJSON *ordered.OrderedMap, replace ReplacePairFunc) error + func PackageLockExtractDependencies(packageLock *ordered.OrderedMap) (map[string]RegistryPackage, map[string]RegistryPackage, error) + func PackageLockReplaceDependencies(packageLock *ordered.OrderedMap, replace ReplaceFunc) error + func ValidateIntegrity(data []byte, algorithm, hash string) error + type CollectPackages struct + ByNodeModulesPath map[string]RegistryPackage + ByURL map[string]RegistryPackage + ParentKey string + func (cp *CollectPackages) Visit(deps *ordered.OrderedMap, k string, v any) error + type PackageJSONReplace struct + ByNodeModulesPath map[string]RegistryPackage + func (pjr *PackageJSONReplace) Replace(name, version string) string + type PackageLockReplace struct + ByURL map[string]RegistryPackage + func (plr *PackageLockReplace) Replace(resolved string) string + type RegistryPackage struct + Algorithm string + Hash string + URL string + func (rp RegistryPackage) Equal(other RegistryPackage) bool + func (rp RegistryPackage) Filename() (string, error) + type ReplaceDependency struct + Replace ReplacePairFunc + func (rd *ReplaceDependency) Visit(deps *ordered.OrderedMap, k string, v any) error + type ReplaceFunc func(value string) string + type ReplacePairFunc func(key, value string) string + type ReplaceResolved struct + ParentKey string + Replace ReplaceFunc + func (rr *ReplaceResolved) Visit(deps *ordered.OrderedMap, k string, v any) error + type TidyFile struct + PackageJSON []byte + PackageLockJSON []byte + PackageLockParsed *ordered.OrderedMap + PackageParsed *ordered.OrderedMap + Packages []RegistryPackage + Root string + Version string + func GenerateTidyFile(root string) (*TidyFile, error) + func ReadTidyFile(root string) (*TidyFile, error) + func (tf *TidyFile) Persist() error + func (tf *TidyFile) Restore() error + func (tf *TidyFile) TidyPackageJSON() error + func (tf *TidyFile) TidyPackageLockJSON() error + type VisitorFunc func(m *ordered.OrderedMap, k string, v any) error