Using dirname in ESModules

13 de jul. de 2023

Using _dirname in ESM context

import * as url from 'url';

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