项目作者: axetroy

项目描述 :
Execute Deno script even if you don't have Deno installed
高级语言: Go
项目地址: git://github.com/axetroy/denox.git
创建时间: 2019-12-07T12:03:46Z
项目社区:https://github.com/axetroy/denox

开源协议:

下载


Build Status
Coverage Status
Go Report Card
Latest Version
License
Repo Size

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

Features

  • Cross platform support
  • Install Deno automatically
  • Support any version of Deno with environment variable DENO_VERSION
  • Fully compatible with Deno

Usage

  1. # run script with latest version of Deno
  2. $ denox https://deno.land/std/examples/welcome.ts
  3. # run script with specific version of Deno
  4. $ DENO_VERSION=v0.26.0 denox https://deno.land/std/examples/welcome.ts

Installation

If you are using Linux/MacOS. you can install it with following command:

  1. # install latest version
  2. wget -qO- https://raw.githubusercontent.com/axetroy/denox/master/install.sh | bash
  3. # or install specified version
  4. 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.

  1. # ~/.bash_profile
  2. export PATH="$PATH:~/bin"

finally, try it out.

  1. $ denox https://deno.land/x/std/examples/welcome.ts

Build from source code

Make sure you have Golang@v1.13.1 installed.

  1. $ git clone https://github.com/axetroy/denox.git $GOPATH/src/github.com/axetroy/denox
  2. $ cd $GOPATH/src/github.com/axetroy/denox
  3. $ make build

Test

  1. $ make test

Uninstall

remove $HOME/.denox folder with following command:

  1. $ rm -rf $HOME/.denox

License

The MIT License