@hyperse/dependency-sync
Version:
A comprehensive Node.js utility for managing dependencies in monorepo environments, specifically designed for Hyperse plugin ecosystems.
12 lines (11 loc) • 339 B
JavaScript
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
/**
* Provider method to simulate __dirname veriable.
* @param url - import.meta.url
* @param subDir - sub directory
* @returns __dirname
*/
export const getDirname = (url, ...subDir) => {
return join(dirname(fileURLToPath(url)), ...subDir);
};