Git Product home page Git Product logo

nodeenv's Introduction

Node.js virtual environment

nodeenv (node.js virtual environment) is a tool to create isolated node.js environments.

It creates an environment that has its own installation directories, that doesn't share libraries with other node.js virtual environments.

Install

You can install nodeenv with easy_install:

$ sudo easy_install nodeenv

or pip:

$ sudo pip install nodeenv

If you want to work with the latest version of the nodeenv you can install it from the github repository:

$ git clone https://github.com/ekalinin/nodeenv.git
$ ./nodeenv/nodeenv.py --help

Or you can just download raw nodeenv.py and use it:

$ wget https://raw.github.com/ekalinin/nodeenv/master/nodeenv.py
$ python nodeenv.py --version
0.4.0

Dependency

For nodeenv

  • make
  • curl
  • egrep
  • sort
  • tail
  • tar

For node.js

  • python
  • libssl-dev

Usage

Basic

Install new environment:

$ nodeenv env

Activate new environment:

$ . env/bin/activate

Chek versions of main packages:

(env) $ node -v
v0.4.6

(env) $ npm -v
0.3.18

Deactivate environment:

(env) $ deactivate_node

Advanced

Get available node.js versions:

$ nodeenv --list
0.0.1   0.0.2   0.0.3   0.0.4   0.0.5   0.0.6   0.1.0
0.1.2   0.1.3   0.1.4   0.1.5   0.1.6   0.1.7   0.1.8
0.1.10  0.1.11  0.1.12  0.1.13  0.1.14  0.1.15  0.1.16
0.1.18  0.1.19  0.1.20  0.1.21  0.1.22  0.1.23  0.1.24
0.1.26  0.1.27  0.1.28  0.1.29  0.1.30  0.1.31  0.1.32
0.1.90  0.1.91  0.1.92  0.1.93  0.1.94  0.1.95  0.1.96
0.1.98  0.1.99  0.1.100 0.1.101 0.1.102 0.1.103 0.1.104
0.2.1   0.2.2   0.2.3   0.2.4   0.2.5   0.2.6   0.3.0
0.3.2   0.3.3   0.3.4   0.3.5   0.3.6   0.3.7   0.3.8
0.4.1   0.4.2   0.4.3   0.4.4   0.4.5   0.4.6

Install node.js "0.4.3" without ssl support with 4 parallel commands for compilation and npm.js "0.3.17":

$ nodeenv --without-ssl --node=0.4.3 --npm=0.3.17 --jobs=4 env-4.3

Saving into the file versions of all installed packages:

$ . env-4.3/bin/activate
(env-4.3)$ npm install express
(env-4.3)$ npm install jade
(env-4.3)$ freeze ../prod-requirements.txt

Create environment copy from requirement file:

$ nodeenv --requirement=../prod-requirements.txt --jobs=4 env-copy

Requirements files are plain text files that contain a list of packages to be installed. These text files allow you to create repeatable installations. Requirements file example:

$ cat ../prod-requirements.txt
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Alternatives

There are several alternatives that create isolated environments:

  • nave - Virtual Environments for Node. Nave stores all environments in one directory ~/.nave. Thus it is not possible to create different environments for one version of node.js. Can not pass additional arguments into configure (for example --without-ssl)
  • nvm - Node Version Manager. It is necessarily to do nvm sync for caching available node.js version. Can not pass additional arguments into configure (for example --without-ssl)
  • virtualenv Virtual Python Environment builder. For python only.

nodeenv's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.