mathu/util/dirname.ts
2024-04-24 18:54:55 -07:00

6 lines
191 B
TypeScript

import { fileURLToPath } from "url";
/**
* Pass in `import.meta` to get the __dirname.
*/
export const getDirname = (importMeta: ImportMeta) => fileURLToPath(new URL('.', importMeta.url));