Skip to content

Instantly share code, notes, and snippets.

@vojty
Created October 25, 2021 10:50
Show Gist options
  • Save vojty/4c4acc3a087b583644a25ea19b0c93ab to your computer and use it in GitHub Desktop.
Save vojty/4c4acc3a087b583644a25ea19b0c93ab to your computer and use it in GitHub Desktop.
__dirname with ESM modules
import path from 'path'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment