npm

package
v0.0.0-...-b93a6bd Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package npm exposes a simple set of functions for running npm install and other npm scripts in a given project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction represents a transaction on a NPM project.

func NewTransaction

func NewTransaction(t cbtest.T, dir string, failfast bool) (*Transaction, error)

NewTransaction returns a new *Transaction instance.

func Use

func Use(t cbtest.T, dir string) *Transaction

Use creates a new *NPMTransaction. Panics on failure.

func UseE

func UseE(t cbtest.T, dir string) (*Transaction, error)

UseE creates a new *NPMTransaction. Returns error on failure.

func (*Transaction) Dir

func (tx *Transaction) Dir() string

Dir returns the directory for this transaction.

func (*Transaction) Error

func (tx *Transaction) Error() error

Error returns the error of the last command in the transaction.

func (*Transaction) Failfast

func (tx *Transaction) Failfast() bool

Failfast returns true if the transaction is set to fail fast.

func (*Transaction) Install

func (tx *Transaction) Install() *Transaction

Install runs npm install.

func (*Transaction) Output

func (tx *Transaction) Output() string

Output returns the output of the last command in the transaction.

func (*Transaction) Run

func (tx *Transaction) Run(name string, arg ...string) *Transaction

Run runs the given npm script.

Jump to

Keyboard shortcuts

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