Section: Filesystem and Path

Write file

javascript
javascript
import { writeFile } from "node:fs/promises";
await writeFile("out.json", JSON.stringify(data, null, 2));

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Filesystem and Path
Read file
OpenIn sheetjavascriptsame section
Append file
OpenIn sheetjavascriptsame section
Create directory
OpenIn sheetjavascriptsame section
Read directory
OpenIn sheetjavascriptsame section
Remove file or dir
OpenIn sheetjavascriptsame section
Copy file
OpenIn sheetjavascriptsame section