mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
A modern runtime for JavaScript and TypeScript.
https://deno.com/
e071382768
This PR adds caching to node's `req.headers` ```js import express from "npm:express"; const app = express(); app.get("/", function (req, res) { const ua = req.header("User-Agent"); const auth = req.header("Authorization"); const type = req.header("Content-Type"); const ip = req.header("X-Forwarded-For"); res.end(); }); app.listen(3000); ``` **this PR** ``` wrk -d 10s --latency http://127.0.0.1:3000 Running 10s test @ http://127.0.0.1:3000 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 155.64us 152.14us 5.74ms 97.39% Req/Sec 35.00k 1.97k 39.10k 80.69% Latency Distribution 50% 123.00us 75% 172.00us 90% 214.00us 99% 563.00us 703420 requests in 10.10s, 50.31MB read Requests/sec: 69648.45 Transfer/sec: 4.98MB ``` **main** ``` wrk -d 10s --latency http://127.0.0.1:3000 Running 10s test @ http://127.0.0.1:3000 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 217.95us 786.89us 26.26ms 98.23% Req/Sec 32.32k 2.54k 37.19k 87.13% Latency Distribution 50% 130.00us 75% 191.00us 90% 232.00us 99% 1.88ms 649411 requests in 10.10s, 46.45MB read Requests/sec: 64300.44 Transfer/sec: 4.60MB ``` |
||
---|---|---|
.cargo | ||
.devcontainer | ||
.github | ||
bench_util | ||
cli | ||
ext | ||
runtime | ||
test_ffi | ||
test_napi | ||
test_util | ||
third_party@7f1a41fee1 | ||
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.
- Provides
web platform functionality and APIs,
e.g. using ES modules, web workers, and
fetch()
. - Supports TypeScript out of the box.
- Ships only a single executable file.
- Built-in tooling including
deno test
,deno fmt
,deno bench
, and more. - Includes a set of reviewed standard modules guaranteed to work with Deno.
- Supports npm.
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
deno run https://deno.land/std/examples/welcome.ts
Or setup a simple HTTP server:
Deno.serve((_req) => new Response("Hello, World!"));
Additional Resources
- The Deno Manual is a great starting point for additional examples, setting up your environment, using npm, and more.
- Runtime API reference documents all APIs built into Deno CLI.
- Deno Standard Modules do not have external dependencies and are reviewed by the Deno core team.
- deno.land/x is the registry for third party modules.
- Blog is where the Deno team shares important product updates and “how to”s about solving technical problems.
Contributing
We appreciate your help!
To contribute, please read our contributing instructions.