npm

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MPL-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PossibleLockfileFilenames = []string{"npm-shrinkwrap.json", "package-lock.json"}

Functions

func FromLockfile

func FromLockfile(path string) (graph.Deps, error)

FromLockfile generates the dep graph based on the lockfile provided at the supplied path.

func FromNodeModules

func FromNodeModules(path string) (graph.Deps, error)

FromNodeModules generates the dep graph based on the manifest provided at the supplied path

func PackageFromManifest added in v0.7.8

func PackageFromManifest(pathElems ...string) (pkg.Package, error)

PackageFromManifest generates a package definition for the provided manifest in the supplied directory. Performs revision resolution

Types

type DeepDepIdsSet added in v1.0.11

type DeepDepIdsSet map[pkg.ID]bool

type Dependencies added in v1.0.11

type Dependencies map[string]*DependencyLockEntry

type DependencyLockEntry added in v1.0.11

type DependencyLockEntry struct {
	Version      string
	Requires     map[string]string
	Dependencies Dependencies
}

type DependencyMap added in v1.0.11

type DependencyMap map[pkg.ID][]pkg.ID

type Lockfile

type Lockfile struct {
	Name         string
	Version      string
	Dependencies Dependencies
}

func FindAndReadLockfile added in v1.0.11

func FindAndReadLockfile(path string) (Lockfile, error)

FindAndReadLockfile checks the root of the node project at the given path for lockfiles, then returns the parsed contents if one is found.

type Manifest

type Manifest struct {
	Name         string
	Version      string
	Dependencies map[string]string
}

func FromManifest

func FromManifest(pathElems ...string) (Manifest, error)

FromManifest creates a manifest from the filepath provided

type NPM

type NPM interface {
	List(dir string) (Output, error)
	Clean(dir string) error
	Install(dir string) error
	Exists() bool
}

func New added in v0.7.7

func New() (NPM, error)

type Options added in v0.7.7

type Options struct {
	AllowNPMErr bool `mapstructure:"allow-npm-err"`
}

type Output

type Output struct {
	Version      string
	From         string
	Resolved     string
	Dependencies map[string]Output
}

type SystemNPM added in v0.7.7

type SystemNPM struct {
	Cmd      string
	AllowErr bool
}

func (SystemNPM) Clean added in v0.7.7

func (n SystemNPM) Clean(dir string) error

func (SystemNPM) Exists added in v0.7.9

func (n SystemNPM) Exists() bool

func (SystemNPM) Install added in v0.7.7

func (n SystemNPM) Install(dir string) error

func (SystemNPM) List added in v0.7.7

func (n SystemNPM) List(dir string) (Output, error)

Jump to

Keyboard shortcuts

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