Skip to content

Commit 4e0fc7f

Browse files
Add documentation for initializing an empty Deno project (#2807)
1 parent 065430c commit 4e0fc7f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

runtime/reference/cli/init.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,46 @@ Watcher Process started.
145145
deno serve: Listening on http://0.0.0.0:8000/
146146
```
147147

148+
## Initialize an empty project
149+
150+
Running `deno init --empty` bootstraps an empty project with a basic console
151+
log.
152+
153+
```sh
154+
$ deno init --empty
155+
✅ Project initialized
156+
157+
Run these commands to get started
158+
159+
# Run the program
160+
deno run main.ts
161+
162+
# Run the program and watch for file changes
163+
deno task dev
164+
```
165+
166+
Your [`deno.json`](/runtime/fundamentals/configuration/) file will look like
167+
this:
168+
169+
```json
170+
{
171+
"tasks": {
172+
"dev": "deno run --watch main.ts"
173+
}
174+
}
175+
```
176+
177+
Now, you can run the project, which
178+
[watches for changes](/runtime/getting_started/command_line_interface/#watch-mode),
179+
by running `deno task dev`.
180+
181+
```sh
182+
$ deno task dev
183+
Task dev deno run --watch main.ts
184+
Watcher Process started.
185+
Hello world!
186+
```
187+
148188
## Generate a library project
149189

150190
You can append a `--lib` flag to add extra parameters to your `deno.json`, such

0 commit comments

Comments
 (0)