npm

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNpmOptionsFromArgs

func ExtractNpmOptionsFromArgs(args []string) (threads int, jsonOutput bool, cleanArgs []string, buildConfig *utils.BuildConfiguration, err error)

func GetConfigList

func GetConfigList(npmFlags []string, executablePath string) ([]byte, error)

This method runs "npm config list --json" command and returns the json object that contains the current configurations of npm For more info see https://docs.npmjs.com/cli/config

func IsNpmCommand

func IsNpmCommand(cmd string) bool

func Pack

func Pack(npmFlags []string, executablePath string) error

func RunList

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

func Version

func Version(executablePath string) ([]byte, error)

Types

type NpmConfig

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

func (*NpmConfig) GetCmd

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

func (*NpmConfig) GetEnv

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

func (*NpmConfig) GetErrWriter

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

func (*NpmConfig) GetStdWriter

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

type PackageInfo

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

func ReadPackageInfo

func ReadPackageInfo(data []byte) (*PackageInfo, error)

func ReadPackageInfoFromPackageJson

func ReadPackageInfoFromPackageJson(packageJsonDirectory string) (*PackageInfo, error)

func (*PackageInfo) BuildInfoModuleId

func (pi *PackageInfo) BuildInfoModuleId() string

func (*PackageInfo) GetDeployPath

func (pi *PackageInfo) GetDeployPath() string

func (*PackageInfo) GetExpectedPackedFileName

func (pi *PackageInfo) GetExpectedPackedFileName() string

Jump to

Keyboard shortcuts

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