Skip to content

Glossary: Node.js Basics

import.meta.dirname

Also written: import.meta.filename, __dirname

The folder of the current module (`import.meta.filename` is its full path). Building paths from it lets a script find its data files from any folder.

Where the book teaches it

Related terms

Current working directoryCommonJS