Deno
A secure runtime for JavaScript and TypeScript built with V8, Rust, and TokioLinux & Mac | Windows | |
---|---|---|
deno | ||
deno_std | ||
deno_install | ||
registry |
Install #
Using Shell:
curl -fsSL https://deno.land/x/install/install.sh | sh
Or using PowerShell:
iwr https://deno.land/x/install/install.ps1 -useb | iex
Using Homebrew (mac):
brew install deno
Using Scoop (windows):
scoop install deno
Using Cargo:
cargo install deno_cli
See deno_install for more installation options.
Example #
Try running a simple program:
deno https://deno.land/welcome.ts
Or a more complex one:
import { serve } from "https://deno.land/std@v0.12/http/server.ts";
const body = new TextEncoder().encode("Hello World\n");
const s = serve(":8000");
window.onload = async () => {
console.log("http://localhost:8000/");
for await (const req of s) {
req.respond({ body });
}
};