@reliverse/pathkit is a slash‑consistent, cross‑platform path manipulation, with POSIX forward slash, drop‑in for node:path and unjs/pathe. This library extends the node:path module with a set of functions for manipulating file paths.
attaches path segments to an existing path
recursively processes files in a directory to attach path segments to import statements
gets base filename from path
main function to convert import paths from aliases to relative paths
converts extensions in import paths from one format to another
converts aliased path to relative path
gets directory name from path
gets file extension including the dot
gets filename without extension
formats object parts into a path string
analyzes a file's content to extract import and export statements
checks if path is absolute
joins path segments with proper normalization
normalizes a path, resolving . and .. segments
normalizes alias records and optimizes nested aliases
normalizes windows paths to use forward slashes
parses a path into its components
gets relative path from one path to another
resolves path to an absolute path
resolves a path using aliases
finds all alias paths that could resolve to the given path
strips a specified number of segments from the beginning of a path
recursively processes files in a directory to strip path segments from their contents
converts path to namespaced path for windows