Skip to content

Glossary: Next.js Basics

readFile

Also written: node:fs/promises

A function from Node's built-in `node:fs/promises` module that reads a whole file as text and returns a promise. Server Components use it to load `products.json`.

Where the book teaches it

Related terms

process.cwd()