mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
A modern runtime for JavaScript and TypeScript.
https://deno.com/
02dd09a36f
``` ./target/release/deno run cli/bench/async_ops_deferred.js time 794 ms rate 1259445 time 786 ms rate 1272264 time 770 ms rate 1298701 time 784 ms rate 1275510 time 775 ms rate 1290322 time 786 ms rate 1272264 time 773 ms rate 1293661 time 771 ms rate 1297016 time 774 ms rate 1291989 time 767 ms rate 1303780 time 764 ms rate 1308900 time 768 ms rate 1302083 time 763 ms rate 1310615 time 761 ms rate 1314060 time 761 ms rate 1314060 time 762 ms rate 1312335 time 763 ms rate 1310615 time 759 ms rate 1317523 time 760 ms rate 1315789 time 761 ms rate 1314060 time 769 ms rate 1300390 time 763 ms rate 1310615 time 760 ms rate 1315789 time 763 ms rate 1310615 time 761 ms rate 1314060 time 759 ms rate 1317523 time 765 ms rate 1307189 time 760 ms rate 1315789 time 764 ms rate 1308900 time 763 ms rate 1310615 time 760 ms rate 1315789 time 757 ms rate 1321003 time 763 ms rate 1310615 time 759 ms rate 1317523 time 771 ms rate 1297016 time 759 ms rate 1317523 time 759 ms rate 1317523 time 763 ms rate 1310615 time 754 ms rate 1326259 time 755 ms rate 1324503 time 762 ms rate 1312335 time 752 ms rate 1329787 time 755 ms rate 1324503 time 754 ms rate 1326259 time 759 ms rate 1317523 time 754 ms rate 1326259 time 749 ms rate 1335113 time 753 ms rate 1328021 time 756 ms rate 1322751 time 753 ms rate 1328021 ``` ``` samply record -r 20000 target/release/deno run cli/bench/async_ops_deferred.js ``` https://share.firefox.dev/43Efvm6 |
||
---|---|---|
.cargo | ||
.devcontainer | ||
.github | ||
bench_util | ||
cli | ||
core | ||
ext | ||
ops | ||
runtime | ||
serde_v8 | ||
test_ffi | ||
test_napi | ||
test_util | ||
third_party@fef5eaa2e3 | ||
tools | ||
.dlint.json | ||
.dprint.json | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.rustfmt.toml | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE.md | ||
README.md | ||
Releases.md | ||
rust-toolchain.toml |
Deno
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
Features
- Secure by default. No file, network, or environment access, unless explicitly enabled.
- Supports TypeScript out of the box.
- Ships only a single executable file.
- Built-in utilities.
- Set of reviewed standard modules that are guaranteed to work with Deno.
Install
Shell (Mac, Linux):
curl -fsSL https://deno.land/install.sh | sh
PowerShell (Windows):
irm https://deno.land/install.ps1 | iex
Homebrew (Mac):
brew install deno
Chocolatey (Windows):
choco install deno
Scoop (Windows):
scoop install deno
Build and install from source using Cargo:
cargo install deno --locked
See deno_install and releases for other options.
Getting Started
Try running a simple program:
deno run https://deno.land/std/examples/welcome.ts
Or a more complex one:
const listener = Deno.listen({ port: 8000 });
console.log("http://localhost:8000/");
for await (const conn of listener) {
serve(conn);
}
async function serve(conn: Deno.Conn) {
for await (const { respondWith } of Deno.serveHttp(conn)) {
respondWith(new Response("Hello world"));
}
}
You can find a deeper introduction, examples, and environment setup guides in the manual.
The complete API reference is available at the runtime documentation.
Contributing
We appreciate your help!
To contribute, please read our contributing instructions.