npmutils

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDependenciesList

func CalculateDependenciesList(typeRestriction TypeRestriction, npmArgs []string, executablePath, buildInfoModuleId string) (dependenciesList map[string]*Dependency, err error)

func FindNpmExecutable

func FindNpmExecutable() (path string, err error)

func IsNpmCommand added in v2.1.0

func IsNpmCommand(cmd string) bool

func RunList added in v2.1.0

func RunList(flags, executablePath string) (stdResult, errResult []byte, err error)

Types

type Dependency

type Dependency struct {
	Name       string
	Version    string
	Scopes     []string
	FileType   string
	Checksum   *buildinfo.Checksum
	PathToRoot [][]string
}

func (*Dependency) GetPathToRoot

func (dep *Dependency) GetPathToRoot() [][]string

type NpmConfig added in v2.1.0

type NpmConfig struct {
	Npm          string
	Command      []string
	CommandFlags []string
	StrWriter    io.WriteCloser
	ErrWriter    io.WriteCloser
}

func (*NpmConfig) GetCmd added in v2.1.0

func (config *NpmConfig) GetCmd() *exec.Cmd

func (*NpmConfig) GetEnv added in v2.1.0

func (config *NpmConfig) GetEnv() map[string]string

func (*NpmConfig) GetErrWriter added in v2.1.0

func (config *NpmConfig) GetErrWriter() io.WriteCloser

func (*NpmConfig) GetStdWriter added in v2.1.0

func (config *NpmConfig) GetStdWriter() io.WriteCloser

type TypeRestriction

type TypeRestriction int
const (
	DefaultRestriction TypeRestriction = iota
	All
	DevOnly
	ProdOnly
)

Jump to

Keyboard shortcuts

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