fs Module

noun

say it: “EF-ESS MOJ-ool” /ˌɛfˈɛs ˈmɒdʒuːl/

Node's built-in module for reading, writing and managing files and folders.

What does fs Module do?

The fs module reads and writes files.

import { readFile } from 'node:fs/promises';
const text = await readFile('recipes.json', 'utf8');

In a sentence

  • “The training log saves each run with the fs module's writeFile.”
  • “Import the promise version of the fs module from node:fs/promises.”

Level: Apprentice · More Node.js terms at this level

Updated