Skip to content

Instantly share code, notes, and snippets.

@afkvido
Last active February 28, 2023 21:14
Show Gist options
  • Save afkvido/d19bcad338f489fb92c8c61d3896a26f to your computer and use it in GitHub Desktop.
Save afkvido/d19bcad338f489fb92c8c61d3896a26f to your computer and use it in GitHub Desktop.
EMCAscript fill for CommonJS __dirname.
import path from "path";
import { fileURLToPath } from "url";
const dirname : string = path.resolve(fileURLToPath(import.meta.url), "../..");
export default dirname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment