NodeJsFile System Module (fs)

The 'fs' module allows you to interact with the file system. You can read, write, update, and delete files using this module, making it essential for backend development in Node.js.

const fs = require('fs');

// Writing to a file
fs.writeFileSync('example.txt', 'Hello, file system!');

// Reading from a file
const data = fs.readFileSync('example.txt', 'utf8');
console.log(data);