Node FS

Node FS is a builtin module in Node.js that helps you work with files and operate on them.

Node FS

Node FS File Operations

With Node FS, you may do following actions on files :

  • Reading files
  • Creating or Overwriting files
  • Updating files
  • Deleting files
  • Renaming files

Include Node.js FS Module

To include Node.js FS module in Node.js program, use the following require() statement.

</>
Copy
var fs = require('fs');

Examples

Following tutorials, provide you examples on the possible file operations that could be done using Node.js File System builtin module.

Conclusion

In this Node.js Tutorial, we have learnt to work with files using Node.js FS Module