summaryrefslogtreecommitdiff
path: root/docs/examples/unix_cat.md
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-07-12 19:44:42 +0200
committerGitHub <noreply@github.com>2021-07-12 19:44:42 +0200
commit51e0bfda3c5df4fa1f1b36301193038ed6aaf7bf (patch)
treef730a56750444a94fdb42e508326d61754d24e07 /docs/examples/unix_cat.md
parent00484d24ba93418bbdde8e42483d56e3714efaa0 (diff)
chore(runtime): deprecate `Deno.copy` (#11369)
Diffstat (limited to 'docs/examples/unix_cat.md')
-rw-r--r--docs/examples/unix_cat.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/examples/unix_cat.md b/docs/examples/unix_cat.md
index fc09d4e27..0ce28d718 100644
--- a/docs/examples/unix_cat.md
+++ b/docs/examples/unix_cat.md
@@ -7,8 +7,8 @@
command line arguments.
- [Deno.open](https://doc.deno.land/builtin/stable#Deno.open) is used to get a
handle to a file.
-- [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) is used to
- transfer data from the file to the output stream.
+- [copy](https://doc.deno.land/https/deno.land/std@$STD_VERSION/io/util.ts#copy)
+ is used to transfer data from the file to the output stream.
- Files should be closed when you are finished with them
- Modules can be run directly from remote URLs.
@@ -21,9 +21,10 @@ is opened, and printed to stdout (e.g. the console).
/**
* cat.ts
*/
+import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts";
for (const filename of Deno.args) {
const file = await Deno.open(filename);
- await Deno.copy(file, Deno.stdout);
+ await copy(file, Deno.stdout);
file.close();
}
```