Module

std/node/url.ts

Deno standard library
Go to Latest
function pathToFileURL
import { pathToFileURL } from "https://deno.land/std@0.145.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.