Skip to main content

Posts

Showing posts from August, 2026

The File System (FS) module in Node.js

  Hello my lovely audience on the internet! Today we will move ahead and learn about “fs” module in Nodejs. We will understand this “fs” module, how to use it inside Nodejs with some code samples. This post will be long so please stay tuned and let's code together. Introduction If you have some knowledge of working with frontend development or at least you have written some JavaScript code in the browser, you know that the browsers are heavily sandboxed. When you visit a website, you are actually running untrusted code written by strangers and so to prevent your computer from any unwanted peril, browsers are designed to run JavaScript code inside a strict sandbox. Due to this, you can’t simply open a user’s Desktop / Documents folder and start reading their documents. But Node.js runs on the same Google Chrome’s V8 engine which is responsible for parsing the same JavaScript code. So, using Node.js can you read or write in a document? You might think “No”, but actually this is p...