Skip to main content
Home
This release is 37 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.209.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.

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().

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
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
posix
No documentation available
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
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
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.

I
GlobOptions

Options for globToRegExp.

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
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.

v
basename
No documentation available
v
common
No documentation available
v
delimiter
No documentation available
v
dirname
No documentation available
v
extname
No documentation available
v
format
No documentation available
v
fromFileUrl
No documentation available
v
globToRegExp
No documentation available
v
isAbsolute
No documentation available
v
isGlob
No documentation available
v
join
No documentation available
v
joinGlobs
No documentation available
v
normalize
No documentation available
v
normalizeGlob
No documentation available
v
parse
No documentation available
v
relative
No documentation available
v
resolve
No documentation available
v
SEP
No documentation available
v
sep
No documentation available
v
SEP_PATTERN
No documentation available
v
toFileUrl
No documentation available
v
toNamespacedPath
No documentation available
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.

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
globToRegExp

Convert a glob string to a regular expression.

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
globToRegExp

Convert a glob string to a regular expression.

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.

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
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
basename
No documentation available
v
common
No documentation available
v
delimiter
No documentation available
v
dirname
No documentation available
v
extname
No documentation available
v
format
No documentation available
v
fromFileUrl
No documentation available
v
globToRegExp
No documentation available
v
isAbsolute
No documentation available
v
isGlob
No documentation available
v
join
No documentation available
v
joinGlobs
No documentation available
v
normalize
No documentation available
v
normalizeGlob
No documentation available
v
parse
No documentation available
v
relative
No documentation available
v
resolve
No documentation available
v
SEP
No documentation available
v
sep
No documentation available
v
SEP_PATTERN
No documentation available
v
toFileUrl
No documentation available
v
toNamespacedPath
No documentation available

windows

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.

f
globToRegExp

Convert a glob string to a regular expression.

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().

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

Utilities for working with OS-specific file paths.

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.

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
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
globToRegExp

Convert a glob string to a regular expression.

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
globToRegExp

Convert a glob string to a regular expression.

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.

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

New Ticket: 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.