Struct npm_rs::NpmEnv[][src]

pub struct NpmEnv(_);
Expand description

This struct is used to create the enviroment in which npm will execute commands. NpmEnv uses Command so it takes all the env variables in your system.

After the environment is configured, use NpmEnv::init() to start issuing commands to Npm.

Example

use npm_rs::*;

let npm = NpmEnv::default()
                 .with_env("NODE_ENV", "production")
                 .init();

Implementations

Inserts or updates a enviroment variable mapping.

Inserts or updates multiple environment variable mappings.

Clears the entire environment map for Npm.

Removes an enviroment variable mapping.

Sets the working directory for Npm.

Initilizes Npm with the configured environment.

This method will be NpmEnv::init(&self) when Command derives Clone.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.