Skip to main content

@std/path@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)

Utilities for working with OS-specific file paths.

Functions from this module will automatically switch to support the path style of the current OS, either windows for Microsoft Windows, or posix for every other operating system, eg. Linux, MacOS, BSD etc.

To use functions for a specific path style regardless of the current OS import the modules from the platform sub directory instead.

Example, for posix:

import { fromFileUrl } from "@std/path/posix/from_file_url";
const p = fromFileUrl("file:///home/foo");
console.log(p); // "/home/foo"

or, for windows:

import { fromFileUrl } from "@std/path/windows/from_file_url";
const p = fromFileUrl("file:///home/foo");
console.log(p); // "\\home\\foo"

This module is browser compatible.

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 * as path from "@std/path";
or

Import directly with a jsr specifier

import * as path from "jsr:@std/path";