Skip to content

Instantly share code, notes, and snippets.

@phanect
Last active May 24, 2024 07:59
Show Gist options
  • Save phanect/ac21182ea67cfe74471ff2c9217c99f3 to your computer and use it in GitHub Desktop.
Save phanect/ac21182ea67cfe74471ff2c9217c99f3 to your computer and use it in GitHub Desktop.
JSM (JavaScript modules, aka. ESM) Template for task scripts
/*
* Deprecated: Use import.meta.dirname instead.
* https://nodejs.org/api/esm.html#importmetadirname
*/
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = fileURLToPath(new URL(".", import.meta.url));
@phanect
Copy link
Author

phanect commented Mar 7, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment