npm

package
v3.0.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NodeModules is the path of the root npm modules
	// Ex: C:\\Users\\kataras\\AppData\\Roaming\\npm\\node_modules
	NodeModules string
)

Functions

func Abs

func Abs(relativePath string) string

Abs returns the absolute path of the global node_modules directory + relative

func Exists

func Exists(executableRelativePath string) bool

Exists returns true if a module exists here we have two options 1 . search by command something like npm -ls -g --depth=x 2. search on files, we choose the second

Types

type Result

type Result struct {
	// Message the message (string)
	Message string
	// Error the error (if any)
	Error error
}

Result holds Message and Error, if error != nil then the npm command has failed

func Install

func Install(moduleName string) Result

Install installs a module

func Unistall

func Unistall(moduleName string) Result

Unistall removes a module

func (Result) Output

func (res Result) Output() (out string)

Output returns the error message if result.Error exists, otherwise returns the result.Message

Jump to

Keyboard shortcuts

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