Skip to content

Commit f5292d2

Browse files
committed
Merge remote-tracking branch 'origin/main' into worktree-agent-a388cc1de15e55ebb
2 parents b6bd7c2 + 7410b98 commit f5292d2

5 files changed

Lines changed: 225 additions & 359 deletions

File tree

js/tabs.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ for (const tabGroup of document.querySelectorAll<HTMLElement>(".deno-tabs")) {
7979
const storedTabId = localStorage.getItem(`deno-tab-${groupId}`);
8080
if (storedTabId) {
8181
document.dispatchEvent(new GroupSelectEvent(groupId, storedTabId));
82+
} else if (groupId === "operating-systems") {
83+
const ua = navigator.userAgent;
84+
let detected: string | null = null;
85+
if (/Mac/i.test(ua)) detected = "mac";
86+
else if (/Win/i.test(ua)) detected = "windows";
87+
else if (/Linux/i.test(ua)) detected = "linux";
88+
if (detected) {
89+
document.dispatchEvent(new GroupSelectEvent(groupId, detected));
90+
}
8291
}
8392

8493
const anyTabActive = Array.from(tabs).some((tab) =>
Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
---
2-
last_modified: 2025-03-10
2+
last_modified: 2026-05-28
33
title: Making a Deno project
44
description: "Step-by-step guide to creating your first Deno project. Learn how to initialize a project, understand the basic file structure, run TypeScript code, and execute tests using Deno's built-in test runner."
55
oldUrl: /runtime/manual/getting_started/first_steps/
66
---
77

8-
Deno has many [built in tools](/runtime/reference/cli/) to make your development
9-
experience as smooth as possible. One of these tools is the
10-
[project initializer](/runtime/reference/cli/init), which creates a new Deno
11-
project with a basic file structure and configuration.
12-
13-
While you are welcome to use JavaScript, Deno has built-in support for
14-
[TypeScript](https://www.typescriptlang.org/) as well, so we'll be using
15-
TypeScript in this guide. If you'd prefer to use JavaScript, you can rename the
16-
files to `.js` and remove the type annotations.
8+
In this guide, you'll create your first Deno project, run it, and execute its
9+
tests. We'll use [TypeScript](https://www.typescriptlang.org/) throughout. To
10+
follow along in JavaScript instead, rename the files to `.js` and remove the
11+
type annotations.
1712

1813
## Initialize a new project
1914

@@ -33,31 +28,33 @@ my_project
3328
└── main.ts
3429
```
3530

36-
A `deno.json` file is created to
37-
[configure your project](/runtime/fundamentals/configuration/), and two
38-
TypeScript files are created; `main.ts` and `main_test.ts`. As of Deno 2.8 the
39-
`main.ts` file contains a small HTTP server built on
40-
[`Deno.serve`](/api/deno/~/Deno.serve) — it shows off Deno's built-in HTTP
41-
server, `Response.json()`, and TypeScript working out of the box. The handler is
42-
exported and guarded by `import.meta.main`, so `main_test.ts` can import and
43-
call it directly without binding to a port.
31+
[`deno.json`](/runtime/fundamentals/configuration/) holds your project
32+
configuration. `main.ts` is a small HTTP server built on
33+
[`Deno.serve`](/api/deno/~/Deno.serve), and `main_test.ts` has the tests for it.
4434

4535
## Run your project
4636

37+
Move into the new project directory:
38+
39+
```bash
40+
cd my_project
41+
```
42+
4743
You can run this program with the following command:
4844

4945
```bash
50-
$ deno main.ts
46+
$ deno -N main.ts
5147
Listening on http://localhost:8000/
5248
```
5349

50+
The server needs network permission, granted here via `-N` (short for
51+
`--allow-net`). See [security](/runtime/fundamentals/security/) for more.
52+
5453
Open the URL in your browser to see the response.
5554

5655
## Run your tests
5756

58-
Deno has a [built in test runner](/runtime/fundamentals/testing/). You can write
59-
tests for your code and run them with the `deno test` command. Run the tests in
60-
your new project with:
57+
Run the tests with [`deno test`](/runtime/fundamentals/testing/):
6158

6259
```bash
6360
$ deno test
@@ -68,9 +65,4 @@ handler returns 404 for unknown route ... ok (1ms)
6865
ok | 2 passed | 0 failed (3ms)
6966
```
7067

71-
Now that you have a basic project set up you can start building your
72-
application. Check out our [examples and tutorials](/examples/) for more ideas
73-
on what to build with Deno.
74-
75-
You can
76-
[learn more about using TypeScript in Deno here](/runtime/fundamentals/typescript).
68+
Browse our [examples and tutorials](/examples/) for ideas on what to build next.

runtime/getting_started/installation.md

Lines changed: 48 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ oldUrl:
88
- /runtime/fundamentals/installation
99
---
1010

11-
Deno works on macOS, Linux, and Windows. Deno is a single binary executable. It
12-
has no external dependencies. On macOS, both M1 (arm64) and Intel (x64)
13-
executables are provided. On Windows, both ARM64 and x64 are supported. On
14-
Linux, only x64 is supported.
11+
Deno is a single binary executable with no external dependencies. It runs on
12+
macOS, Linux, and Windows, on both x64 and arm64 architectures.
1513

1614
## Download and install
1715

1816
[deno_install](https://github.com/denoland/deno_install) provides convenience
1917
scripts to download and install the binary.
2018

2119
<deno-tabs group-id="operating-systems">
22-
<deno-tab value="mac" label="macOS" default>
20+
<deno-tab value="linux" label="Linux">
2321

2422
Using Shell:
2523

@@ -33,52 +31,43 @@ Using [npm](https://npmjs.com/package/deno):
3331
npm install -g deno
3432
```
3533

36-
> <small>The startup time of the Deno command gets affected if it's installed
37-
> via npm. We recommend the shell install script for better performance.</small>
38-
39-
Using [Homebrew](https://formulae.brew.sh/formula/deno):
34+
Using [Nix](https://nixos.org/download.html):
4035

4136
```shell
42-
brew install deno
37+
nix-shell -p deno
4338
```
4439

45-
Using [MacPorts](https://ports.macports.org/port/deno/):
40+
</deno-tab>
41+
<deno-tab value="mac" label="macOS" default>
42+
43+
Using Shell:
4644

4745
```shell
48-
sudo port install deno
46+
curl -fsSL https://deno.land/install.sh | sh
4947
```
5048

51-
Using [Nix](https://nixos.org/download.html):
49+
Using [npm](https://npmjs.com/package/deno):
5250

5351
```shell
54-
nix-shell -p deno
52+
npm install -g deno
5553
```
5654

57-
Using [asdf](https://asdf-vm.com/):
55+
Using [Homebrew](https://formulae.brew.sh/formula/deno):
5856

5957
```shell
60-
asdf plugin add deno https://github.com/asdf-community/asdf-deno.git
61-
62-
# Download and install the latest version of Deno
63-
asdf install deno latest
64-
65-
# To set as the default version of Deno globally
66-
asdf set -u deno latest
67-
68-
# To set as the default version of Deno locally (current project only)
69-
asdf set deno latest
58+
brew install deno
7059
```
7160

72-
Using [vfox](https://vfox.dev/):
61+
Using [MacPorts](https://ports.macports.org/port/deno/):
7362

7463
```shell
75-
vfox add deno
64+
sudo port install deno
65+
```
7666

77-
# Download and install the latest version of Deno
78-
vfox install deno@latest
67+
Using [Nix](https://nixos.org/download.html):
7968

80-
# To set the version of Deno globally
81-
vfox use --global deno
69+
```shell
70+
nix-shell -p deno
8271
```
8372

8473
</deno-tab>
@@ -100,10 +89,6 @@ Using [npm](https://npmjs.com/package/deno):
10089
npm install -g deno
10190
```
10291

103-
> <small>The startup time of the Deno command gets affected if it's installed
104-
> via npm. We recommend the PowerShell install script for better
105-
> performance.</small>
106-
10792
Using [Scoop](https://scoop.sh/):
10893

10994
```shell
@@ -122,41 +107,16 @@ Using [Winget](https://github.com/microsoft/winget-cli):
122107
winget install DenoLand.Deno
123108
```
124109

125-
Using [vfox](https://vfox.dev/):
126-
127-
```shell
128-
vfox add deno
129-
130-
# Download and install the latest version of Deno
131-
vfox install deno@latest
132-
133-
# To set the version of Deno globally
134-
vfox use --global deno
135-
```
136-
137110
</deno-tab>
138-
<deno-tab value="linux" label="Linux">
139-
140-
Using Shell:
141-
142-
```shell
143-
curl -fsSL https://deno.land/install.sh | sh
144-
```
145-
146-
Using [npm](https://npmjs.com/package/deno):
147-
148-
```shell
149-
npm install -g deno
150-
```
111+
</deno-tabs>
151112

152113
> <small>The startup time of the Deno command gets affected if it's installed
153-
> via npm. We recommend the shell install script for better performance.</small>
114+
> via npm. We recommend the official install script (shell or PowerShell) for
115+
> better performance.</small>
154116
155-
Using [Nix](https://nixos.org/download.html):
117+
### Cross-platform package managers
156118

157-
```shell
158-
nix-shell -p deno
159-
```
119+
These version managers work on macOS, Linux, and Windows.
160120

161121
Using [asdf](https://asdf-vm.com/):
162122

@@ -185,9 +145,6 @@ vfox install deno@latest
185145
vfox use --global deno
186146
```
187147

188-
</deno-tab>
189-
</deno-tabs>
190-
191148
You can also build and install from source using
192149
[Cargo](https://crates.io/crates/deno):
193150

@@ -273,6 +230,24 @@ To update a previously installed version of Deno, you can run:
273230
deno upgrade
274231
```
275232

233+
Or using [Homebrew](https://formulae.brew.sh/formula/deno) (macOS):
234+
235+
```shell
236+
brew upgrade deno
237+
```
238+
239+
Or using [Scoop](https://scoop.sh/) (Windows):
240+
241+
```shell
242+
scoop update deno
243+
```
244+
245+
Or using [Chocolatey](https://chocolatey.org/packages/deno) (Windows):
246+
247+
```shell
248+
choco upgrade deno
249+
```
250+
276251
Or using [Winget](https://github.com/microsoft/winget-cli) (Windows):
277252

278253
```shell
@@ -286,7 +261,7 @@ unzip it, and replace your current executable with it.
286261
You can also use this utility to install a specific version of Deno:
287262

288263
```shell
289-
deno upgrade --version 1.0.1
264+
deno upgrade --version 2.7.0
290265
```
291266

292267
## Uninstalling
@@ -307,8 +282,10 @@ Then remove the Deno installation directory:
307282
rm -rf ~/.deno
308283
```
309284

310-
Finally, remove the `DENO_INSTALL` export and `PATH` entry from your shell
311-
config file (`~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`, etc.).
285+
Finally, remove the line that sources Deno's env file from your shell config
286+
(`~/.bashrc`, `~/.zshrc`, `~/.profile`, etc.). The shell install script appends
287+
a line like `. "$HOME/.deno/env"` — delete that line. Fish users should
288+
additionally remove `~/.config/fish/conf.d/deno.fish`.
312289

313290
</deno-tab>
314291
<deno-tab value="windows" label="Windows">

0 commit comments

Comments
 (0)