O'Reilly logo

Node.js Recipes: A Problem-Solution Approach by Cory Gackenheimer

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 3

image

Using the File System

In many instances within an application, you will want to work with the file system. Node.js makes this straightforward by creating a wrapper around standard file I/O operations that are present on the operating system. In Node.js these capabilities are centered around one of the Node.js native modules, fs. This chapter will provide examples of how to utilize the file-system module in your Node.js application. In this chapter you will learn how to perform these actions:

  • Retrieve directory structures
  • Navigate directories
  • Manipulate directory structures
  • Watch directories for modifications
  • Read and write files

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