Using dirname in ESModules

Jul 13, 2023

Using _dirname in ESM context

import * as url from 'url';

const __dirname = url.fileURLToPath(new URL('.', import.meta.url));