diff options
Diffstat (limited to 'docs/getting_started')
-rw-r--r-- | docs/getting_started/first_steps.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/getting_started/first_steps.md b/docs/getting_started/first_steps.md index 9a0fdab7c..fda5bc47b 100644 --- a/docs/getting_started/first_steps.md +++ b/docs/getting_started/first_steps.md @@ -86,10 +86,11 @@ In this program each command-line argument is assumed to be a filename, the file is opened, and printed to stdout. ```ts +import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts"; const filenames = Deno.args; for (const filename of filenames) { const file = await Deno.open(filename); - await Deno.copy(file, Deno.stdout); + await copy(file, Deno.stdout); file.close(); } ``` @@ -111,12 +112,13 @@ This is an example of a server which accepts connections on port 8080, and returns to the client anything it sends. ```ts +import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts"; const hostname = "0.0.0.0"; const port = 8080; const listener = Deno.listen({ hostname, port }); console.log(`Listening on ${hostname}:${port}`); for await (const conn of listener) { - Deno.copy(conn, conn); + copy(conn, conn); } ``` |