Skip to content

Instantly share code, notes, and snippets.

@TravisMullen
Last active October 19, 2019 22:48
Show Gist options
  • Save TravisMullen/ab43052b4e7b38b794b9686193793703 to your computer and use it in GitHub Desktop.
Save TravisMullen/ab43052b4e7b38b794b9686193793703 to your computer and use it in GitHub Desktop.
Emergency nodejs: when you need that bin yesterday.
#!/bin/bash
# /** instant nodejs **/
# get it
wget https://nodejs.org/dist/v12.12.0/node-v12.12.0-linux-x64.tar.xz
tar xf node-v12.*.*-linux-*.tar.xz
# validate it
echo 'console.log(`versions: ${console.log(process.versions)} - nodejs.`)' > versions.js
./node-v12.*.*-linux-*/bin/node versions.js
rm versions.js
# @arg {$1:string} - location of `.js` gist
if [ $# -eq 1 ]
then
# run it
wget $1 -O app.js
./node-v12.*.*-linux-*/bin/node app.js
fi
# @arg {$2:boolean} - indicates post execution purge
if [ $# -eq 2 ]
then
# # remove it [all]
rm -r ./node-v12.*.*-linux-*
rm app.js
fi
# # or run it as npm
# git clone https://github.com/TravisMullen/TravisMullen-Vue.git tmp
# cd tmp
# ./node-v12.*.*-linux-*/bin/npm i
# ./node-v12.*.*-linux-*/bin/npm run build --modern
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment