From 82e6ace060808968c5793b708bc05c90003503b8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 24 May 2018 21:34:44 +0000 Subject: [PATCH] make docs more readable --- README.md | 59 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fd3e175..b2b7671 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,39 @@ wget -nv https://bit.ly/node-installer -O - ./node-installer.sh; bash ./node-ins ### Choosing a specific version +**Latest** + +```bash +export NODEJS_VER="" +``` + +**Exact** + +```bash +export NODEJS_VER="v10.2.1" +``` + +**Latest of vX.Y.Z** + +```bash +export NODEJS_VER="v8.1" +``` + +**Latest of vX.YY.Z** + +```bash +# latest of v8.11.x +export NODEJS_VER="v8.11" +``` + +**Latest of vX.Y** + +```bash +export NODEJS_VER="v10" +``` + +Fun FYI, here's how the latest version is determined: + ```bash NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f 1 | head -1 ) echo "The current node.js version is $NODEJS_VER" @@ -46,25 +79,6 @@ NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f echo "Latest node.js $BASE_VER is $NODEJS_VER" ``` -To install the latest of a specific version rather than defaulting to latest - -```bash -### latest version -export NODEJS_VER="" - -# exact version -export NODEJS_VER="v10.2.1" - -# latest of v8.1.x -export NODEJS_VER="v8.1" - -# latest of v8.11.x -export NODEJS_VER="v8.11" - -# latest of v10.x -export NODEJS_VER="v10" -``` - ### Choosing an install location Just set BOTH `NODE_PATH` and `NPM_CONFIG_PREFIX`. @@ -74,10 +88,15 @@ The install path will be the preceding `lib/node_modules` ```bash export NPM_CONFIG_PREFIX=/tmp/user/local export NODE_PATH=/tmp/user/local/lib/node_modules +``` +```bash curl -fsSL https://bit.ly/node-installer -o ./node-installer.sh; bash ./node-installer.sh --dev-deps +``` -# If you want to add the install location to your PATH +If you want to add the install location to your `PATH`: + +```bash PATH=$PATH:/tmp/user/local/bin ```