deno.land / x / manual@v1.28.2 / examples / unix_cat.md
In this program each command-line argument is assumed to be a filename, the file is opened, and printed to stdout (e.g. the console).
/**
* cat.ts
*/
import { copy } from "https://deno.land/std@$STD_VERSION/streams/conversion.ts";
for (const filename of Deno.args) {
const file = await Deno.open(filename);
await copy(file, Deno.stdout);
file.close();
}
To run the program:
deno run --allow-read https://deno.land/std@$STD_VERSION/examples/cat.ts /etc/passwd
Version Info