Skip to content

Instantly share code, notes, and snippets.

@frank-dspeed
Last active June 3, 2025 09:11
Show Gist options
  • Save frank-dspeed/942237811b60caa0d17eb89816178bf3 to your computer and use it in GitHub Desktop.
Save frank-dspeed/942237811b60caa0d17eb89816178bf3 to your computer and use it in GitHub Desktop.
Run
#!/usr/bin/env node
console.log("Look Ma, I'm executing JavaScript from a gist inside the terminal with npx!");
console.log(process.argv);
{
"name": "js-from-terminal-with-npx",
"version": "1.8.8",
"bin": "./index.js"
}
@frank-dspeed
Copy link
Author

frank-dspeed commented Jun 3, 2025

npx https://gist.github.com/frank-dspeed/942237811b60caa0d17eb89816178bf3

above method is only great for one time installers it will install the repo in a temp folder always

else prefer

npm i -g https://gist.github.com/frank-dspeed/942237811b60caa0d17eb89816178bf3
npx js-from-terminal-with-npx

rerun npm i from time to time for updates

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