Skip to content

Instantly share code, notes, and snippets.

@Luke-zhang-04
Created February 1, 2022 22:52
Show Gist options
  • Select an option

  • Save Luke-zhang-04/8f6e385cd9fff63f4e3d30ed0210b692 to your computer and use it in GitHub Desktop.

Select an option

Save Luke-zhang-04/8f6e385cd9fff63f4e3d30ed0210b692 to your computer and use it in GitHub Desktop.
dirname in mjs
// __dirname in esm
import {dirname} from "path"
import {fileURLToPath} from "url"
const __dirname = dirname(fileURLToPath(import.meta.url))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment