Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to dicretely install fs module in node

Tags:

node.js

npm

I am trying to use readFile from fs module(node version 5.3.0). But I get an error saying module not found. Do i need to install fs module separately? If so exactly what package to install? It is not available by default?

Tried using fs as:

var freader = require('fs');
freader.readFile(...
like image 206
Rajeev Ranjan Avatar asked Sep 11 '25 20:09

Rajeev Ranjan


1 Answers

Here is the documentation about fs.

File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.


You have no npm package to install, it's included in node.js.


EDIT: here is the documentation of fs for node v5.3 and it's the same

like image 155
Orelsanpls Avatar answered Sep 13 '25 11:09

Orelsanpls