Rajeev Ranjan
Rajeev Ranjan

Reputation: 4076

Do I need to dicretely install fs module in node

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(...

Upvotes: 4

Views: 10860

Answers (1)

Orelsanpls
Orelsanpls

Reputation: 23515

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

Upvotes: 11

Related Questions