Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/url.ts>fileURLToPath

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function fileURLToPath
import { fileURLToPath } from "https://deno.land/std@0.145.0/node/url.ts";

This function ensures the correct decodings of percent-encoded characters as well as ensuring a cross-platform valid absolute path string.

Parameters

path: string | URL

The file URL string or URL object to convert to a path.

Returns

string

The fully-resolved platform-specific Node.js file path.