close
Skip to main content
This release is versions behind 1.1.5 — the latest version of @std/path.
Works with
This package works with Cloudflare Workers, Deno, Browsers
This package works with Cloudflare Workers
This package works with Deno
This package works with Browsers
JSR Score100%
Downloads83,449/wk
Published3 years ago (0.210.0)

Utilities for working with file system paths

function toFileUrl
toFileUrl(path: string): URL

Converts a path string to a file URL.

import { toFileUrl } from "@std/path/windows/to_file_url";

toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")

Parameters

to convert to file URL

Return Type

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/path

Import symbol

import { toFileUrl } from "@std/path/windows";
or

Import directly with a jsr specifier

import { toFileUrl } from "jsr:@std/path/windows";