summaryrefslogtreecommitdiff
path: root/examples/cat.ts
blob: 38fdbb2cce424df664d6342320950a5b0a4da36b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import * as deno from "deno";

async function cat(filenames: string[]): Promise<void> {
  for (let filename of filenames) {
    let file = await deno.open(filename);
    await deno.copy(deno.stdout, file);
    file.close();
  }
}

cat(deno.args.slice(1));