Asked to make a laboratory and an import error occurred
//dao.ts file
import * as fs from "fs";
const file = fs.readFileSync("foo.txt", "utf8");
console.log(file);
I write "node dao.ts" in console and i have error:
import * as fs from "fs";
^^^^^^
SyntaxError: Cannot use import statement outside a module