Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/deno/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ const result = dylib.symbols.add(35, 34); // 69
console.log(`Result from external addition of 35 and 34: ${result}`);
```

Run with `--allow-ffi` and `--unstable` flag:
Run with the `--allow-ffi` flag:

```sh
deno run --allow-ffi ffi.ts
Expand Down
44 changes: 8 additions & 36 deletions runtime/contributing/architecture.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified: 2025-03-10
last_modified: 2026-11-16
title: "Architecture Overview"
description: "Deep dive into Deno's internal architecture, explaining core components like the runtime, compiler, and security sandbox. Learn how Deno processes requests and executes JavaScript/TypeScript code."
oldUrl: /runtime/manual/references/contributing/architecture/
Expand All @@ -14,46 +14,18 @@ oldUrl: /runtime/manual/references/contributing/architecture/
| File descriptors (fd) | [Resource ids (rid)](#resources) |
| Scheduler | Tokio |
| Userland: libc++ / glib / boost | https://jsr.io/@std |
| /proc/\$\$/stat | [Deno.metrics()](#metrics) |
| man pages | deno types / https://docs.deno.com |

### Resources

Resources (AKA `rid`) are Deno's version of file descriptors. They are integer
values used to refer to open files, sockets, and other concepts. For testing it
would be good to be able to query the system for how many open resources there
are.

```ts
console.log(Deno.resources());
// { 0: "stdin", 1: "stdout", 2: "stderr" }
Deno.close(0);
console.log(Deno.resources());
// { 1: "stdout", 2: "stderr" }
```

### Metrics

Metrics is Deno's internal counter for various statistics.

```shell
> console.table(Deno.metrics())
┌─────────────────────────┬───────────┐
│ (idx) │ Values │
├─────────────────────────┼───────────┤
│ opsDispatched │ 9 │
│ opsDispatchedSync │ 0 │
│ opsDispatchedAsync │ 0 │
│ opsDispatchedAsyncUnref │ 0 │
│ opsCompleted │ 9 │
│ opsCompletedSync │ 0 │
│ opsCompletedAsync │ 0 │
│ opsCompletedAsyncUnref │ 0 │
│ bytesSentControl │ 504 │
│ bytesSentData │ 0 │
│ bytesReceived │ 856 │
└─────────────────────────┴───────────┘
```
values used internally to refer to open files, sockets, and other concepts.
Since Deno 2, they are no longer exposed through public APIs: close a resource
with the `.close()` method on the object that owns it, such as a
[`Deno.FsFile`](/api/deno/~/Deno.FsFile). To check that tests don't leave
resources open, use the
[resource sanitizer](/runtime/test/sanitizers/#resource-sanitizer) of
`deno test`.

## Conference

Expand Down
Loading