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

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

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.222.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. It does the opposite of parse.

T
FormatInputPathObject
No documentation available
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
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. Use format to reverse the result.

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
SEPARATOR
No documentation available
v
SEPARATOR_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.

v
DELIMITER
No documentation available
v
SEPARATOR
No documentation available
v
SEPARATOR_PATTERN
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. It does the opposite of parse.

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

I
GlobOptions

Options for globToRegExp.

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

I
GlobOptions

Options for globToRegExp.

f
normalizeGlob

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

f
parse

Return a ParsedPath object of the path. Use format to reverse the result.

posix

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
GlobOptions

Options for globToRegExp.

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
SEPARATOR
No documentation available
v
SEPARATOR_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.

v
DELIMITER
No documentation available
v
SEPARATOR
No documentation available
v
SEPARATOR_PATTERN
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
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.

I
GlobOptions

Options for globToRegExp.

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

I
GlobOptions

Options for globToRegExp.

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

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

f
toFileUrl

Converts a path string to a file URL.

f
toNamespacedPath

Resolves path to a namespace path

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.

I
GlobOptions

Options for globToRegExp.

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
SEPARATOR
No documentation available
v
SEPARATOR_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.

v
DELIMITER
No documentation available
v
SEPARATOR
No documentation available
v
SEPARATOR_PATTERN
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
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.

I
GlobOptions

Options for globToRegExp.

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

I
GlobOptions

Options for globToRegExp.

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

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.