Skip to content

Glossary: Node.js Basics

mkdtemp / tmpdir

Also written: mkdtemp, tmpdir, temporary folder

`tmpdir()` from `node:os` returns the system's temporary folder, and `mkdtemp(prefix)` creates a new, uniquely named folder inside it. Tests use them so they never touch real data.

Where the book teaches it

Related terms

Test isolation