mathu/util/dirname.ts

6 lines
191 B
TypeScript
Raw Permalink Normal View History

2024-04-24 18:54:55 -07:00
import { fileURLToPath } from "url";
/**
* Pass in `import.meta` to get the __dirname.
*/
export const getDirname = (importMeta: ImportMeta) => fileURLToPath(new URL('.', importMeta.url));