Skip to content

Instantly share code, notes, and snippets.

@lotharthesavior
Created July 27, 2021 22:31
Show Gist options
  • Save lotharthesavior/07ea91972bb202ed514cda0464abdc98 to your computer and use it in GitHub Desktop.
Save lotharthesavior/07ea91972bb202ed514cda0464abdc98 to your computer and use it in GitHub Desktop.
Run node where you have only docker
function nodeBase {
docker run --rm -v $(pwd):/app -w /app node:13 $1 $2 $3 $4
}
function node {
nodeBase node $1 $2 $3
}
function npm {
nodeBase npm $1 $2 $3
}
@lotharthesavior
Copy link
Author

The intention is to add the function at run-node.sh in your bash profile.

Usage:

node index.js
node -v
npm install
npm -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment