---
title: "Discussion on \"FS (File System Module) in Node.js\" | Hashnode"
description: "Discussion on \"FS (File System Module) in Node.js\". First import 'fs' (file system) module using:\nconst fs = require('fs')\n###Read a file\nSyntax:\nconst file = fs.readFileSync(\"Relative_Directory_Path/file.js\",{encoding: 'utf-8'}) \n//just write the encoding part even if you don't know what does it mean..."
url: "https://hashnode.com/posts/fs-file-system-module-in-nodejs/607998635af33606b2563630"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [FS (File System Module) in Node.js](https://hashnode.pratikpathak.com/fs-file-system-module-in-nodejs?utm_source=hashnode&utm_medium=feed)

First import 'fs' (file system) module using: const fs = require('fs') ###Read a file Syntax: const file = fs.readFileSync("Relative\_Directory\_Path/file.js",{encoding: 'utf-8'}) //just write the encoding part even if you don't know what does it mean...

Apr 16, 2021 · 2 min read · hashnode.pratikpathak.com  
Read the article

-   [#js](https://hashnode.com/tag/js)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#apis](https://hashnode.com/tag/apis)
-   [#files](https://hashnode.com/tag/files)

## Written by

[Pratik Pathak](https://hashnode.com/@pratikpathak)

@pratikpathak

  
[View profile](https://hashnode.com/@pratikpathak)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
