Andrew's Digital Garden

__dirname in Node

__dirname = absolute path of the currently executing file.

Useful for config files to load things relative to where the file lives.

Note that this only exists in CJS.

[[20250627030527-cjs-esm-bundling]]

[[node]]

`__dirname` in Node