Skip to content

Commit c0a8c0b

Browse files
committed
Add editor configuration files and README lint and tweaks
1 parent ac4c60b commit c0a8c0b

File tree

3 files changed

+48
-29
lines changed

3 files changed

+48
-29
lines changed

.editorconfig

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
tab_width = 2
12+
trim_trailing_whitespace = true
13+
14+
# Tab indentation (no size specified)
15+
[{Makefile,makefile}]
16+
indent_style = tab
17+
18+
[*.md]
19+
# indent 4 for code blocks
20+
indent_size = 4
21+
# preserve trailing space for line breaks
22+
trim_trailing_whitespace = false

.markdownlint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"ul-indent": { "indent": 4 },
3+
"line-length": false
4+
}

README.md

+22-29
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
Node.js version management: no subshells, no profile setup, no convoluted API, just **simple**.
99

10-
![](http://nimit.io/images/n/n.gif)
10+
![usage animation](http://nimit.io/images/n/n.gif)
1111

12-
(Unfortunately `n` is not supported on Windows.)
12+
(Note: `n` is not supported natively on Windows.)
1313

1414
- [`n` – Interactively Manage Your Node.js Versions](#n-%E2%80%93-interactively-manage-your-nodejs-versions)
1515
- [Installation](#installation)
@@ -27,20 +27,20 @@ Node.js version management: no subshells, no profile setup, no convoluted API, j
2727

2828
Since you probably already have `node`, the easiest way to install `n` is through `npm`:
2929

30-
$ npm install -g n
30+
npm install -g n
3131

3232
Alternatively, you can clone this repo and
3333

34-
$ make install
34+
make install
3535

3636
to install `n` to `bin/n` of the directory specified in the environment variable `$PREFIX`, which defaults to `/usr/local` (note that you will likely need to use `sudo`). To install `n` in a custom location (such as `$CUSTOM_LOCATION/bin/n`), run `PREFIX=$CUSTOM_LOCATION make install`.
3737

3838
Once installed, `n` installs `node` versions to subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`; the _active_ `node` version is installed directly in `N_PREFIX`.
39-
To change the default to, say, `$HOME`, prefix later calls to `n` with `N_PREFIX=$HOME ` or add `export N_PREFIX=$HOME` to your shell initialization file.
39+
To change the default to, say, `$HOME`, prefix later calls to `n` with `N_PREFIX=$HOME` or add `export N_PREFIX=$HOME` to your shell initialization file.
4040

4141
To avoid requiring `sudo` for `n` and `npm` global installs, it is recommended you either install to your home directory using `N_PREFIX`, or take ownership of the system directories:
4242

43-
```
43+
```bash
4444
# make cache folder (if missing) and take ownership
4545
sudo mkdir -p /usr/local/n
4646
sudo chown -R $(whoami) /usr/local/n
@@ -60,17 +60,16 @@ On Linux and macOS, [n-install](https://github.com/mklement0/n-install) allows i
6060

6161
n-install sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$HOME/n/bin`, modifies the initialization files of supported shells to export `N_PREFIX` and add `$HOME/n/bin` to the `PATH`, and installs the latest stable `node` version.
6262

63-
6463
As a result, both `n` itself and all `node` versions it manages are hosted inside a single, optionally configurable directory, which you can later remove with the included `n-uninstall` script. `n-update` updates `n` itself to the latest version. See the [n-install repo](https://github.com/mklement0/n-install) for more details.
6564

6665
## Installing/Activating Node Versions
6766

6867
Simply execute `n <version>` to install a version of `node`. If `<version>` has already been installed (via `n`), `n` will activate that version.
6968
A leading v is optional, and a partial version number installs the newest matching version.
7069

71-
$ n 4.9.1
72-
$ n 10
73-
$ n v8.11.3
70+
n 4.9.1
71+
n 10
72+
n v8.11.3
7473

7574
Execute `n` on its own to view your currently installed versions. Use the up and down arrow keys to navigate and press enter to select. Use `q` or ^C (control + C) to exit the selection screen.
7675
If you like vim key bindings during the selection of node versions, you can use `j` and `k` to navigate up or down without using arrows.
@@ -83,27 +82,21 @@ If you like vim key bindings during the selection of node versions, you can use
8382

8483
Use or install the latest official release:
8584

86-
$ n latest
85+
n latest
8786

8887
Use or install the latest LTS official release:
8988

90-
$ n lts
89+
n lts
9190

9291
## Removing Versions
9392

9493
Remove some versions:
9594

96-
$ n rm 0.9.4 v0.10.0
97-
98-
Alternatively, you can use `-` in lieu of `rm`:
99-
100-
$ n - 0.9.4
95+
n rm 0.9.4 v0.10.0
10196

10297
Removing all versions except the current version:
10398

104-
```bash
105-
$ n prune
106-
```
99+
n prune
107100

108101
## Binary Usage
109102

@@ -115,11 +108,11 @@ them directly by asking `n` for the binary path:
115108

116109
Or by using a specific version through `n`'s `use` sub-command:
117110

118-
$ n use 0.9.4 some.js
111+
n use 0.9.4 some.js
119112

120113
Flags also work here:
121114

122-
$ n as 0.9.4 --debug some.js
115+
n as 0.9.4 --debug some.js
123116

124117
## Usage
125118

@@ -171,26 +164,26 @@ For example, to grab the latest io.js version:
171164

172165
Required Variables:
173166

174-
* `PROJECT_NAME`: The name the project will be stored under
175-
* `PROJECT_URL`: The location to download the project from. Note, this must follow the same format as the Node.js repos
167+
- `PROJECT_NAME`: The name the project will be stored under
168+
- `PROJECT_URL`: The location to download the project from. Note, this must follow the same format as the Node.js repos
176169

177170
Optional Variables:
178171

179-
* `HTTP_USER`: The username if the `PROJECT_URL` is protected by basic authentication
180-
* `HTTP_PASSWORD`: The password if the `PROJECT_URL` is protected by basic authentication
181-
* `PROJECT_VERSION_CHECK`: Many custom projects keep the same version number as the Node.js release they are based on, and maintain their own separate version in process. This allows you to define a JavaScript variable that will be used to check for the version of the process, for example: `process.versions.node`
172+
- `HTTP_USER`: The username if the `PROJECT_URL` is protected by basic authentication
173+
- `HTTP_PASSWORD`: The password if the `PROJECT_URL` is protected by basic authentication
174+
- `PROJECT_VERSION_CHECK`: Many custom projects keep the same version number as the Node.js release they are based on, and maintain their own separate version in process. This allows you to define a JavaScript variable that will be used to check for the version of the process, for example: `process.versions.node`
182175

183176
## Custom architecture
184177

185178
By default `n` picks the binaries matching your system architecture, e.g. `n` will download 64 bit binaries for a 64 bit system. You can override this by using the `-a` or `--arch` option.
186179

187180
Download and use latest 32 bit version of `node`:
188181

189-
$ n --arch x86 latest
182+
n --arch x86 latest
190183

191184
Download and use 64 bit LTS version of `node` for older Mac Intel Core 2 Duo systems (x86 image is no longer available but x64 runs fine):
192185

193-
$ n --arch x64 lts
186+
n --arch x64 lts
194187

195188
## Additional Details
196189

0 commit comments

Comments
 (0)