fs is not defined in es6 code example
Example: ReferenceError: fs is not defined node js
// Define the `fs` at the beginning of the script
const fs = require('fs');
// Define the `fs` at the beginning of the script
const fs = require('fs');