Created
December 19, 2021 04:19
-
-
Save oshinko/1a5da44318152db92d46973e29e9b91c to your computer and use it in GitHub Desktop.
Alternative to __dirname when using ESM
This file contains 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 path from 'path' | |
import url from 'url' | |
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment