Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
/ nvm-env Public archive

Setting nvm environment variables for `child_process`

License

Notifications You must be signed in to change notification settings

7anshuai/nvm-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvm-env Build Status

Setting nvm environment variables for child_process

⚠️ This package has been deprecated. Use nvm exec instead of.

Installation

$ npm install nvm-env

Usage

var exec = require('child_process').exec;
var nvmEnv = require('nvm-env');

console.log(process.version); // "v6.12.0"
console.log(process.env.NVM_BIN); // "/path/to/.nvm/versions/node/v6.12.0/bin"

var env = nvmEnv('v8.9.3');
console.log(env.NVM_BIN); // "/path/to/.nvm/versions/node/v8.9.3/bin"

exec('node -e "console.log(process.version)"', {env: env}, function (err, stdout, stderr) {
   console.log(err, stdout); // "v8.9.3"
});

Reference

License

MIT

About

Setting nvm environment variables for `child_process`

Resources

License

Stars

Watchers

Forks

Packages

No packages published