Module

std/node/url.ts>pathToFileURL

Deno standard library
Go to Latest
function pathToFileURL
import { pathToFileURL } from "https://dotland.deno.dev/std@0.177.0/node/url.ts";

This function ensures that filepath is resolved absolutely, and that the URL control characters are correctly encoded when converting into a File URL.

Parameters

filepath: string

The file path string to convert to a file URL.

Returns

The file URL object.