📱 For the full interactive experience, visit shellscript.download
load.sh node-docker
node-docker.sh: Create Docker-backed Node.js launchers (node, npm, npx, yarn)
Usage (via loader):
load.sh node-docker -- <node_version>
Examples:
load.sh node-docker -- 22
load.sh node-docker -- 20
Description:
- Generates wrapper scripts in "$HOME/.shellscript/bin" for the selected Node version:
- node<ver> → runs Node inside node:<ver>-alpine
- npm<ver> → runs npm inside node:<ver>-alpine (persisting ~/.npm and honoring ~/.npmrc)
- npx<ver> → runs npx inside node:<ver>-alpine
- yarn<ver> → runs yarn inside node:<ver>-alpine (persisting ~/.cache/yarn)
- Also updates convenience symlinks: node, npm, npx, yarn → their <ver> counterparts.
- Pulls the specified Docker image and marks the wrappers executable.
- Intended for environments where Node.js tooling is not installed natively.
Notes:
- Typical versions: 18, 20, 22 (any tag supported by docker hub node:<tag>-alpine)
- Requires Docker installed and available on PATH. Install with `load.sh docker`
- This script is idempotent and can be re-run to switch versions.