Creates the equivalent of CJS's __dirname and __filename for ESM modules.
__dirname
__filename
This is the equivalent of import.meta.dirname and import.meta.filename added to Node.js v20.11.0 but is compatible with older versions of Node.js as well as browsers.
import.meta.dirname
import.meta.filename
import {getEsmPath} from '@augment-vir/common';const {filePath, dirPath} = getEsmPath(import.meta); Copy
import {getEsmPath} from '@augment-vir/common';const {filePath, dirPath} = getEsmPath(import.meta);
@augment-vir/common
Creates the equivalent of CJS's
__dirname
and__filename
for ESM modules.This is the equivalent of
import.meta.dirname
andimport.meta.filename
added to Node.js v20.11.0 but is compatible with older versions of Node.js as well as browsers.