Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 148 lines (93 sloc) 4.189 kb
e391148 @tj readme
authored
1 # n
2
3 My own flavour of node binary management, no subshells, no profile setup, no convoluted api, just _simple_.
4
5 ## Installation
6
a2f34a7 @tj docs
authored
7 $ npm install -g n
e391148 @tj readme
authored
8
9 or
10
11 $ make install
12
4ddb8b0 @tj Better docs
authored
13 ### Installing Binaries
43923a7 @tj examples
authored
14
4ddb8b0 @tj Better docs
authored
15 Install a few nodes ("v" is optional), the version given becomes the active node binary once installation is complete.
43923a7 @tj examples
authored
16
17 $ n 0.2.6
53eb951 @tj docs
authored
18 $ n v0.3.3
43923a7 @tj examples
authored
19
4ddb8b0 @tj Better docs
authored
20 List installed binaries:
43923a7 @tj examples
authored
21
22 $ n
7285744 Updated readme for N_PREFIX changes
drew authored
23
43923a7 @tj examples
authored
24 0.2.5
4ddb8b0 @tj Better docs
authored
25 ο 0.2.6
43923a7 @tj examples
authored
26 0.3.3
27
800d128 @tj docs
authored
28 Pass some config flags to _./configure_:
29
4ddb8b0 @tj Better docs
authored
30 $ n 0.2.6 --debug
31
32 List installed binaries, config flags are shown:
33
7285744 Updated readme for N_PREFIX changes
drew authored
34 0.2.3
4ddb8b0 @tj Better docs
authored
35 ο 0.2.6 --debug
7285744 Updated readme for N_PREFIX changes
drew authored
36 0.3.4
4ddb8b0 @tj Better docs
authored
37 0.3.5
38
1927720 @tj Added `n latest`
authored
39 Use or install the latest official release:
40
29b1706 @dshaw Added information about using custom tarball support.
dshaw authored
41 $ n latest
42
9b00813 @tomgco Adding information about stable releases
tomgco authored
43 Use or install the stable official release:
44
45 $ n stable
46
29b1706 @dshaw Added information about using custom tarball support.
dshaw authored
47 Install a custom or patched version of node from a tarball:
48
49 $ n custom 0.6.5 https://github.com/dshaw/node/tarball/patch/v0.6.5status
1927720 @tj Added `n latest`
authored
50
4ddb8b0 @tj Better docs
authored
51 ### Removing Binaries
800d128 @tj docs
authored
52
c7244d4 @tj Added `n rm` support
authored
53 Remove some versions:
54
53eb951 @tj docs
authored
55 $ n rm 0.2.4 v0.3.0
c7244d4 @tj Added `n rm` support
authored
56
e2ce508 @tj Added - alias of rm
authored
57 Instead of using `rm` we can simply use `-`:
58
59 $ n - 0.2.4
60
4ddb8b0 @tj Better docs
authored
61 ### Binary Usage
62
0a31d25 @tj Added `n bin <version>` command
authored
63 When running multiple versions of node, we can target
64 them directly by asking `n` for the binary path:
65
66 $ n bin 0.3.3
67 /usr/local/n/versions/0.3.3/bin/node
68
0ce4694 @tj Added `n as <version> [args ...]`
authored
69 Execute a script with 0.3.3 regardless of the active version:
e391148 @tj readme
authored
70
0ce4694 @tj Added `n as <version> [args ...]`
authored
71 $ n use 0.3.3 some.js
e391148 @tj readme
authored
72
0ce4694 @tj Added `n as <version> [args ...]`
authored
73 with flags:
c7244d4 @tj Added `n rm` support
authored
74
0ce4694 @tj Added `n as <version> [args ...]`
authored
75 $ n as 0.3.3 --debug some.js
e391148 @tj readme
authored
76
e44f849 @appleboy Add execute npm arg if node.js version greater than or equal 0.6.3
appleboy authored
77 Execute npm with 0.6.3 regardless of the active version:
78
79 $ n npm 0.6.3 install coffee-script
80 $ n npm 0.6.3 list
81
0ce4694 @tj Added `n as <version> [args ...]`
authored
82 ## Usage
e391148 @tj readme
authored
83
0ce4694 @tj Added `n as <version> [args ...]`
authored
84 Output from `n --help`:
e391148 @tj readme
authored
85
7285744 Updated readme for N_PREFIX changes
drew authored
86 Usage: n [options] [COMMAND] [config]
1927720 @tj Added `n latest`
authored
87
0ce4694 @tj Added `n as <version> [args ...]`
authored
88 Commands:
1927720 @tj Added `n latest`
authored
89
0ce4694 @tj Added `n as <version> [args ...]`
authored
90 n Output versions installed
1927720 @tj Added `n latest`
authored
91 n latest [config ...] Install or activate the latest node release
9b00813 @tomgco Adding information about stable releases
tomgco authored
92 n stable [config ...] Install or activate the latest stable node release
1927720 @tj Added `n latest`
authored
93 n <version> [config ...] Install and/or use node <version>
29b1706 @dshaw Added information about using custom tarball support.
dshaw authored
94 n custom <version> <tarball> [config ...] Install custom node <tarball> with [args ...]
0ce4694 @tj Added `n as <version> [args ...]`
authored
95 n use <version> [args ...] Execute node <version> with [args ...]
e44f849 @appleboy Add execute npm arg if node.js version greater than or equal 0.6.3
appleboy authored
96 n npm <version> [args ...] Execute npm <version> with [args ...]
0ce4694 @tj Added `n as <version> [args ...]`
authored
97 n bin <version> Output bin path for <version>
98 n rm <version ...> Remove the given version(s)
1927720 @tj Added `n latest`
authored
99 n --latest Output the latest node version available
9b00813 @tomgco Adding information about stable releases
tomgco authored
100 n --stable Output the latest stable node version available
0d75b91 @tj Release 0.4.0
authored
101 n ls Output the versions of node available
1927720 @tj Added `n latest`
authored
102
e391148 @tj readme
authored
103 Options:
1927720 @tj Added `n latest`
authored
104
e391148 @tj readme
authored
105 -V, --version Output current version of n
106 -h, --help Display help information
1927720 @tj Added `n latest`
authored
107
0ce4694 @tj Added `n as <version> [args ...]`
authored
108 Aliases:
1927720 @tj Added `n latest`
authored
109
0ce4694 @tj Added `n as <version> [args ...]`
authored
110 - rm
111 which bin
112 use as
29b1706 @dshaw Added information about using custom tarball support.
dshaw authored
113 custom c
1927720 @tj Added `n latest`
authored
114
3d10d31 @tj Added N_PREFIX support
authored
115 ## Details
116
117 `n` by default installs node to _/usr/local/n/versions_, from
118 which it can see what you have currently installed, and activate previously installed versions of node when `n <version>` is invoked again.
119
7285744 Updated readme for N_PREFIX changes
drew authored
120 Activated nodes are then installed to the prefix _/usr/local_, which of course may be altered via the __N_PREFIX__ environment variable.
0fa2038 @tj Activating install
authored
121
3d10d31 @tj Added N_PREFIX support
authored
122 To alter where `n` operates simply export __N_PREFIX__ to whatever you prefer.
123
7285744 Updated readme for N_PREFIX changes
drew authored
124 ## License
73896ff @tj Initial commit
authored
125
126 (The MIT License)
127
128 Copyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
129
130 Permission is hereby granted, free of charge, to any person obtaining
131 a copy of this software and associated documentation files (the
132 'Software'), to deal in the Software without restriction, including
133 without limitation the rights to use, copy, modify, merge, publish,
134 distribute, sublicense, and/or sell copies of the Software, and to
135 permit persons to whom the Software is furnished to do so, subject to
136 the following conditions:
137
138 The above copyright notice and this permission notice shall be
139 included in all copies or substantial portions of the Software.
140
141 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
142 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
143 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
144 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
145 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
146 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
7285744 Updated readme for N_PREFIX changes
drew authored
147 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.