Last active
April 26, 2022 15:37
-
-
Save maxgfr/a1295acfbe81dee1d3ae727d5ad826ab to your computer and use it in GitHub Desktop.
__dirname for es module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fileURLToPath } from 'url'; | |
const __filename = fileURLToPath(import.meta.url); | |
const __dirname = path.dirname(__filename); | |
console.log(__dirname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment