Skip to main content
Home
This release is 5 versions behind 1.1.4 — the latest version of @std/path. Jump to latest

@std/path@1.0.9
Built and signed on GitHub Actions

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 Score94%
Downloads102,227/wk
Published9 months ago (1.0.9)

Utilities for working with file system paths

// Copyright 2018-2025 the Deno authors. MIT license. import * as posix from "./posix/mod.ts"; import * as windows from "./windows/mod.ts"; import { assertEquals } from "jsr:@std/assert@^1.0.13"; Deno.test("windows.toNamespacedPath() returns the namespaced path", () => { { const path = "C:\\path\\to\\file.txt"; const namespacedPath = windows.toNamespacedPath(path); assertEquals(namespacedPath, "\\\\?\\C:\\path\\to\\file.txt"); } // The path starts with double backslashs { const path = "\\\\path\\to\\file.txt"; const namespacedPath = windows.toNamespacedPath(path); assertEquals(namespacedPath, "\\\\?\\UNC\\path\\to\\file.txt"); } // When the input is empty string { const path = ""; const namespacedPath = windows.toNamespacedPath(path); assertEquals(namespacedPath, ""); } }); Deno.test("posix.toNamespacedPath() return the input as is", () => { const path = "/path/to/file.txt"; const namespacedPath = posix.toNamespacedPath(path); assertEquals(namespacedPath, "/path/to/file.txt"); });