Outline

Here is one possible solution to the assignment:

// file-system.ts
import { parse } from 'https://deno.land/std/flags/mod.ts';
import { existsSync } from 'https://deno.land/std/fs/mod.ts'
const { args } = Deno;
const parsedArgs = parse(args);

const filename = parsedArgs.file || 'my-file.txt';

if(existsSync(filename)) {
  console.log(`The file ${filename} already exists!`)
} else {
  Deno.writeTextFileSync(`./${filename}`, 'I just wrote this file!');
}
 

I finished! On to the next chapter