lib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadTarballAndUnpack

func DownloadTarballAndUnpack(dist Dist, outputDir string) (err error)

Types

type Dependencies

type Dependencies []Dependency

func (*Dependencies) UnmarshalJSON

func (vs *Dependencies) UnmarshalJSON(b []byte) error

type Dependency

type Dependency struct {
	Name         string
	VersionRange string
}

type Dist

type Dist struct {
	ShaSum  string `json:"shasum"`
	Tarball string `json:"tarball"`
}

type DistTags

type DistTags struct {
	Latest string
}

func (*DistTags) UnmarshalJSON

func (tags *DistTags) UnmarshalJSON(b []byte) error

type NpmPackage

type NpmPackage struct {
	Name     string   `json:"name"`
	DistTags DistTags `json:"dist-tags"`
	Versions Versions `json:"versions"`
}

func FetchPackage

func FetchPackage(s string) (NpmPackage, error)

type Version

type Version struct {
	Name         string       `json:"name"`
	Version      string       `json:"version"`
	Dependencies Dependencies `json:"dependencies"`
	Dist         Dist         `json:"dist"`
}

func FetchPackageVersion

func FetchPackageVersion(pack, version string) (Version, error)

type Versions

type Versions []Version

func (Versions) ByVersion

func (vs Versions) ByVersion(v string) (ver Version, found bool)

func (*Versions) UnmarshalJSON

func (vs *Versions) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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