A dead simple way to get the Deno equivalent of dirname path and filename.
You can get this package from denopkg or from deno.land/x or from nest.land.
import dirname from "https://x.nest.land/[email protected]/mod/dirname.ts";
import path from "https://x.nest.land/[email protected]/mod/path.ts";
import filename from "https://x.nest.land/[email protected]/mod/filename.ts";
const __dirname = dirname(import.meta);
const __path = path(import.meta);
const __filename = filename(import.meta);You can also generate both of them in one go!
import generate from "https://x.nest.land/[email protected]/mod.ts";
const { dirname, path, filename } = generate(import.meta);