diff options
Diffstat (limited to 'std/examples/curl.ts')
| -rw-r--r-- | std/examples/curl.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/std/examples/curl.ts b/std/examples/curl.ts index 04dd9d601..e020016f8 100644 --- a/std/examples/curl.ts +++ b/std/examples/curl.ts @@ -1,8 +1,4 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -async function curl(url: string): Promise<void> { - const res = await fetch(url); - await Deno.copy(Deno.stdout, res.body); -} - -await curl(Deno.args[1]); -Deno.exit(0); +const url = Deno.args[1]; +const res = await fetch(url); +await Deno.copy(Deno.stdout, res.body); |
