@sidekick-coder/db
Version:
Cli Tool to manipulate data from diferent sources
16 lines (13 loc) • 407 B
JavaScript
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
// src/utils/usePath.ts
var usePath = (url) => {
const __filename = fileURLToPath(url);
const __dirname = dirname(__filename);
return { __filename, __dirname };
};
function rootPath(...paths) {
const { __dirname } = usePath(import.meta.url);
return resolve(__dirname, "..", ...paths);
}
export { rootPath, usePath };