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

x/ayonli_jsext/path.ts>toFsPath

A JavaScript extension package for building strong and modern applications.
Latest
function toFsPath
import { toFsPath } from "https://deno.land/x/ayonli_jsext@v0.9.72/path.ts";

Converts the given URL to a file system path if it's not one already.

Examples

Example 1

import { toFsPath } from "@ayonli/jsext/path";

console.log(toFsPath("file:///foo/bar")); // "/foo/bar"
console.log(toFsPath("file:///c:/foo/bar")); // "c:\\foo\\bar"

Parameters

url: string

Returns

string