From 151ce0266eb4de2c8fc600c81c192a5f791b6169 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 9 Oct 2019 17:10:09 -0400 Subject: Move everything into std subdir --- std/examples/cat.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 std/examples/cat.ts (limited to 'std/examples/cat.ts') diff --git a/std/examples/cat.ts b/std/examples/cat.ts new file mode 100644 index 000000000..3626e3c29 --- /dev/null +++ b/std/examples/cat.ts @@ -0,0 +1,10 @@ +// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +async function cat(filenames: string[]): Promise { + for (const filename of filenames) { + const file = await Deno.open(filename); + await Deno.copy(Deno.stdout, file); + file.close(); + } +} + +cat(Deno.args.slice(1)); -- cgit v1.2.3