Execute Deno script even if you don't have Deno installed
Why? It looks the same as Deno’s command line, so why do I need such a tool?
There are scenarios where I need to run the same script with different versions of Deno
In such scenarios, Deno’s version manager may not be the best option
DENO_VERSION
# run script with latest version of Deno
$ denox https://deno.land/std/examples/welcome.ts
# run script with specific version of Deno
$ DENO_VERSION=v0.26.0 denox https://deno.land/std/examples/welcome.ts
If you are using Linux/MacOS
. you can install it with following command:
# install latest version
wget -qO- https://raw.githubusercontent.com/axetroy/denox/master/install.sh | bash
# or install specified version
wget -qO- https://raw.githubusercontent.com/axetroy/denox/master/install.sh | bash -s v0.1.1
Or you can
Download the executable file for your platform at release page
Then set the environment variable.
eg, the executable file is in the ~/bin
directory.
# ~/.bash_profile
export PATH="$PATH:~/bin"
finally, try it out.
$ denox https://deno.land/x/std/examples/welcome.ts
Make sure you have Golang@v1.13.1 installed.
$ git clone https://github.com/axetroy/denox.git $GOPATH/src/github.com/axetroy/denox
$ cd $GOPATH/src/github.com/axetroy/denox
$ make build
$ make test
remove $HOME/.denox
folder with following command:
$ rm -rf $HOME/.denox
The MIT License