From aec5a646c9218a0a0da62cbcd1f28bc23c242540 Mon Sep 17 00:00:00 2001 From: Andy Hayden Date: Sun, 27 Oct 2019 06:04:42 -0700 Subject: feat: top-level-for-await (#3212) --- std/examples/curl.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'std/examples/curl.ts') 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 { - 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); -- cgit v1.2.3