deno: Get the path of the current script in

In deno obtaining the path of the current script is done via the import.meta.url api:

const scriptPath = new URL(import.meta.url).pathname;

On Windows though this will return a path with unix style path seperators and a leading /:

/D:/Code/deno-path-of-script/main.ts
Read More