O'Reilly logo

Node.js in Practice by Alex Young and Marc Harter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required