npm

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 9 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, devDeps bool) (graph.Deps, error)

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

func FromNodeModules

func FromNodeModules(path string, devDeps bool) (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(devDeps bool, 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
	DevDependencies 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, devDeps bool) (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, devDeps bool) (Output, error)

Jump to

Keyboard shortcuts

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