Skip to content

Instantly share code, notes, and snippets.

@ry
Created July 15, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ry/49f21bc8e56c25fd45fd0aa44b17d531 to your computer and use it in GitHub Desktop.
Save ry/49f21bc8e56c25fd45fd0aa44b17d531 to your computer and use it in GitHub Desktop.
diff --git a/website/manual.md b/website/manual.md
index 4025e5ac..de489ed8 100644
--- a/website/manual.md
+++ b/website/manual.md
@@ -425,7 +425,7 @@ $ deno run --allow-net=deno.land allow-net-whitelist-example.ts
Example:
```ts
-async function main() {
+window.onload = async function() {
// create subprocess
const p = Deno.run({
args: ["echo", "hello"]
@@ -434,8 +434,6 @@ async function main() {
// await its completion
await p.status();
}
-
-main();
```
Run it:
@@ -450,7 +448,7 @@ By default when you use `Deno.run()` subprocess inherits `stdin`, `stdout` and
you can use `"piped"` option.
```ts
-async function main() {
+window.onload = async function() {
const decoder = new TextDecoder();
const fileNames = Deno.args.slice(1);
@@ -480,8 +478,6 @@ async function main() {
Deno.exit(code);
}
-
-main();
```
When you run it:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment