16 lines
309 B
TypeScript
16 lines
309 B
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { dirname } from "node:path";
|
|
|
|
const getFilename = (moduleUrl: string) => {
|
|
return fileURLToPath(moduleUrl);
|
|
}
|
|
|
|
const getDirname = (moduleUrl: string) => {
|
|
return dirname(getFilename(moduleUrl));
|
|
};
|
|
|
|
export {
|
|
getFilename,
|
|
getDirname,
|
|
};
|