0.0.7
๐พ ๐ฆ โ
World's First Unversal Script, Zero Install Necessary
Repository
Current version released
3 years ago
What is this for?
Making scripts that work on a freshly setup PC (no prerequisites/manual dependencies)
How do I use it?
- Write a deno script, lets call it
example.js
console.log("Hello World")- Install guillotine
deno install -Af https://deno.land/x/deno_guillotine@0.0.7/main/deno-guillotine.js- Make your script portable
deno-guillotine ./example.js
# if you have a particular version of deno you want to use, include it as the second argument
deno-guillotine ./example.js 1.24.3- Profit
It will generate two files. One with no extension, and one with a.ps1extension. One file is a shortcut to the other. Typing./examplewill run the file with a specific version of deno, and if the user doesnโt have that version its downloaded automatically. This script also does not modify the userโs PATH, so it will never override their version of deno if they have one. Technically only the .ps1 file is needed and running./example.ps1will work on all platforms, but obviously typing that extra.ps1is ugly. Which is why the extra file is generated as well to make the./examplework cross platform.
How does it work?
Magic. The generated script is valid powershell, bash, and JavaScript all at the same time, which is what allows it to run cross-platform. I wrote out an explaination here that covers the basics, and I may write more in time.