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

Utilities for working with file system paths

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 Score
94%
Published
2 years ago (0.201.0)

default

Utilities for working with OS-specific file paths.

f
basename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

f
common

Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator.

v
delimiter
No documentation available
f
dirname

Return the directory path of a path.

f
extname

Return the extension of the path with leading period.

f
format

Generate a path from FormatInputPathObject object.

T
FormatInputPathObject
No documentation available
f
fromFileUrl

Converts a file URL to a path string.

I
f
globToRegExp

Convert a glob string to a regular expression.

T
GlobToRegExpOptions
No documentation available
f
isAbsolute

Verifies whether provided path is absolute

f
isGlob

Test whether the given string is a glob

f
join

Join all given a sequence of paths,then normalizes the resulting path.

f
joinGlobs

Like join(), but doesn't collapse "**/.." when globstar is true.

f
normalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
normalizeGlob

Like normalize(), but doesn't collapse "**/.." when globstar is true.

f
parse

Return a ParsedPath object of the path.

I
ParsedPath

A parsed path object generated by path.parse() or consumed by path.format().

v
posix
No documentation available
f
relative

Return the relative path from from to to based on current working directory.

f
resolve

Resolves path segments into a path

v
SEP
No documentation available
v
SEP_PATTERN
No documentation available
f
toFileUrl

Converts a path string to a file URL.

f
toNamespacedPath

Resolves path to a namespace path

v
win32
No documentation available
f
basename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

f
posixBasename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

f
windowsBasename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

f
common

Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator.

f
dirname

Return the directory path of a path.

f
posixDirname

Return the directory path of a path.

f
windowsDirname

Return the directory path of a path.

f
extname

Return the extension of the path with leading period.

f
posixExtname

Return the extension of the path with leading period.

f
windowsExtname

Return the extension of the path with leading period.

f
format

Generate a path from FormatInputPathObject object.

f
fromFileUrl

Converts a file URL to a path string.

I
f
globToRegExp

Convert a glob string to a regular expression.

T
GlobToRegExpOptions
No documentation available
f
isGlob

Test whether the given string is a glob

f
joinGlobs

Like join(), but doesn't collapse "**/.." when globstar is true.

f
normalizeGlob

Like normalize(), but doesn't collapse "**/.." when globstar is true.

f
isAbsolute

Verifies whether provided path is absolute

f
join

Join all given a sequence of paths,then normalizes the resulting path.

f
posixJoin

Join all given a sequence of paths,then normalizes the resulting path.

f
windowsJoin

Join all given a sequence of paths,then normalizes the resulting path.

f
normalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
posixNormalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
windowsNormalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
parse

Return a ParsedPath object of the path.

f
basename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

v
delimiter
No documentation available
f
dirname

Return the directory path of a path.

f
extname

Return the extension of the path with leading period.

f
format

Generate a path from FormatInputPathObject object.

f
fromFileUrl

Converts a file URL to a path string.

f
isAbsolute

Verifies whether provided path is absolute

f
join

Join all given a sequence of paths,then normalizes the resulting path.

f
normalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
parse

Return a ParsedPath object of the path.

f
relative

Return the relative path from from to to based on current working directory.

f
resolve

Resolves path segments into a path

v
sep
No documentation available
f
toFileUrl

Converts a path string to a file URL.

f
toNamespacedPath

Resolves path to a namespace path

f
relative

Return the relative path from from to to based on current working directory.

f
resolve

Resolves path segments into a path

v
SEP
No documentation available
v
SEP_PATTERN
No documentation available
f
toFileUrl

Converts a path string to a file URL.

f
toNamespacedPath

Resolves path to a namespace path

f
basename

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

v
delimiter
No documentation available
f
dirname

Return the directory path of a path.

f
extname

Return the extension of the path with leading period.

f
format

Generate a path from FormatInputPathObject object.

f
fromFileUrl

Converts a file URL to a path string.

f
isAbsolute

Verifies whether provided path is absolute

f
join

Join all given a sequence of paths,then normalizes the resulting path.

f
normalize

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

f
parse

Return a ParsedPath object of the path.

f
relative

Return the relative path from from to to based on current working directory.

f
resolve

Resolves path segments into a path

v
sep
No documentation available
f
toFileUrl

Converts a path string to a file URL.

f
toNamespacedPath

Resolves path to a namespace path