npmutils

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 18 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 GetNpmVersionAndExecPath added in v2.2.0

func GetNpmVersionAndExecPath() (*version.Version, string, 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)

func Version added in v2.2.0

func Version(executablePath string) (*version.Version, 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 PackageInfo added in v2.2.0

type PackageInfo struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Scope   string
}

func ReadPackageInfo added in v2.2.0

func ReadPackageInfo(data []byte, npmVersion *version.Version) (*PackageInfo, error)

func ReadPackageInfoFromPackageJson added in v2.2.0

func ReadPackageInfoFromPackageJson(packageJsonDirectory string, npmVersion *version.Version) (*PackageInfo, error)

func (*PackageInfo) BuildInfoModuleId added in v2.2.0

func (pi *PackageInfo) BuildInfoModuleId() string

func (*PackageInfo) FullName added in v2.2.0

func (pi *PackageInfo) FullName() string

func (*PackageInfo) GetDeployPath added in v2.2.0

func (pi *PackageInfo) GetDeployPath() string

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