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 ¶
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.