I'm facing an issue where Visual Studio Code does not seem to recognize CLI "Deno.args" in the code snippet below. I've already confirmed that deno is enabled in my settings.json.
import { readStringDelim } from "https://deno.land/std/io/buffer.ts";
async function tail(fileName: string) {
const fileReader = await Deno.open(fileName);
await Deno.seek(fileReader.rid, 0, Deno.SeekMode.End);
const watcher = Deno.watchFs(fileName);
for await (const event of watcher) {
if (event.kind !== "modify") continue;
for await (const line of readStringDelim(fileReader, "\n")) {
if (!line) break;
yield (line.trim());
}
}
}
const file = Deno.args[0];
if (!file) {
console.error("File must be provided");
Deno.exit(1);
}
for await (const line of tail(file)) {
console.log("Got line:", line);
}