mirror of
https://github.com/denoland/deno.git
synced 2025-08-25 21:15:10 +00:00
Website and manual improvements (#1967)
This commit is contained in:
parent
842627d6b9
commit
9444bd71a0
3 changed files with 30 additions and 13 deletions
|
@ -34,7 +34,19 @@ function res(baseRes: null | msg.Base): Metrics {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Receive metrics from the privileged side of Deno. */
|
/** Receive metrics from the privileged side of Deno.
|
||||||
|
*
|
||||||
|
* > console.table(Deno.metrics())
|
||||||
|
* ┌──────────────────┬────────┐
|
||||||
|
* │ (index) │ Values │
|
||||||
|
* ├──────────────────┼────────┤
|
||||||
|
* │ opsDispatched │ 9 │
|
||||||
|
* │ opsCompleted │ 9 │
|
||||||
|
* │ bytesSentControl │ 504 │
|
||||||
|
* │ bytesSentData │ 0 │
|
||||||
|
* │ bytesReceived │ 856 │
|
||||||
|
* └──────────────────┴────────┘
|
||||||
|
*/
|
||||||
export function metrics(): Metrics {
|
export function metrics(): Metrics {
|
||||||
return res(dispatch.sendSync(...req()));
|
return res(dispatch.sendSync(...req()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<img id="logo" src="images/deno_logo_3.svg" width=200>
|
<img id="logo" src="images/deno_logo_3.svg" width=200>
|
||||||
<div>
|
<div>
|
||||||
<h1>Deno</h1>
|
<h1>Deno</h1>
|
||||||
A browser-like command line runtime
|
A secure JavaScript/TypeScript runtime built with V8, Rust, and Tokio
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -109,11 +109,11 @@ href="https://github.com/denoland/deno_install/blob/master/install.ps1">https://
|
||||||
<p>Or a more complex one:</p>
|
<p>Or a more complex one:</p>
|
||||||
|
|
||||||
<pre><code class="typescript language-typescript">import { serve } from "https://deno.land/std@v0.3.2/http/server.ts";
|
<pre><code class="typescript language-typescript">import { serve } from "https://deno.land/std@v0.3.2/http/server.ts";
|
||||||
const s = serve("0.0.0.0:8000");
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
for await (const req of s) {
|
const body = new TextEncoder().encode("Hello World\n");
|
||||||
req.respond({ body: new TextEncoder().encode("Hello World\n") });
|
for await (const req of serve(":8000")) {
|
||||||
|
req.respond({ body });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,10 +148,8 @@ submodule. However, you need to install separately:
|
||||||
3. Python 2.
|
3. Python 2.
|
||||||
[Not 3](https://github.com/denoland/deno/issues/464#issuecomment-411795578).
|
[Not 3](https://github.com/denoland/deno/issues/464#issuecomment-411795578).
|
||||||
|
|
||||||
Extra steps for Mac users:
|
Extra steps for Mac users: install [XCode](https://developer.apple.com/xcode/)
|
||||||
|
:(
|
||||||
1. [XCode](https://developer.apple.com/xcode/)
|
|
||||||
2. Openssl 1.1: `brew install openssl@1.1` (TODO: shouldn't be necessary)
|
|
||||||
|
|
||||||
Extra steps for Windows users:
|
Extra steps for Windows users:
|
||||||
|
|
||||||
|
@ -606,10 +604,17 @@ close(3);
|
||||||
|
|
||||||
Metrics is deno's internal counters for various statics.
|
Metrics is deno's internal counters for various statics.
|
||||||
|
|
||||||
```ts
|
```shellsession
|
||||||
const { metrics } = Deno;
|
> console.table(Deno.metrics())
|
||||||
console.log(metrics());
|
┌──────────────────┬────────┐
|
||||||
// output like: { opsDispatched: 1, opsCompleted: 1, bytesSentControl: 40, bytesSentData: 0, bytesReceived: 176 }
|
│ (index) │ Values │
|
||||||
|
├──────────────────┼────────┤
|
||||||
|
│ opsDispatched │ 9 │
|
||||||
|
│ opsCompleted │ 9 │
|
||||||
|
│ bytesSentControl │ 504 │
|
||||||
|
│ bytesSentData │ 0 │
|
||||||
|
│ bytesReceived │ 856 │
|
||||||
|
└──────────────────┴────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
### Schematic diagram
|
### Schematic diagram
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue