6. Accessing the File System from Node.js

Interacting with the file system in Node.js is extremely important, especially if you need to manage dynamic files to support a web application or service. Node.js provides a good interface for interacting with the file system in the fs module. This module provides the standard file access APIs that are available in most languages to open, read, write, and interact with files.

This chapter explains the fundamentals of accessing the file system from Node.js applications. You should come away with the ability to create, read, and modify files as well as navigate the directory structure. You will also be able to access file and folder information and delete, truncate, and rename files and folders.

For all ...

Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.