Chapter 6. File system: Synchronous and asynchronous approaches to files

This chapter covers

  • Understanding the fs module and its components
  • Working with configuration files and file descriptors
  • Using file-locking techniques
  • Recursive file operations
  • Writing a file database
  • Watching files and directories

As we’ve noted in previous chapters, Node’s core modules typically stick to a low-level API. This allows for various (even competing) ideas and implementations of higher-level concepts like web frameworks, file parsers, and command-line tools to exist as third-party modules. The fs (or file system) module is no different.

The fs module allows the developer to interact with the file system by providing

  • POSIX file I/O primitives

Get Node.js in Practice 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.