An esbuild plugin that replaces __dirname, __filename, __line, __relativedirname, and __relativefilename with actual source file metadata at build time. Version 0.0.6, no release cadence documented. Unlike Node.js's __dirname (which resolves to the output file), this plugin provides the original source path, and the __line variable is unique among Node-like bundlers. Ships TypeScript declarations. Lightweight, no dependencies. Suitable for esbuild bundling projects that need source-level location globals.
Verified import paths — ran on the pinned version, not inferred.
ESM default import is the correct way. CJS require with destructuring of default fails because the package is ESM.
The default export is a factory function that must be called (with no arguments) to create the plugin instance.
Types are declared as ambient globals via a triple-slash reference. Direct import of types is not supported.
Build a TypeScript file with esbuild and replace __dirname, __filename, __line, etc. with source location values.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.