path
1.9.1, released 2 years ago by dart.dev
A string-based path manipulation library supporting Windows, POSIX, and the web.
WASM-readyQuiet but busy
What it does
Provides common operations for manipulating paths such as joining, splitting, and normalizing. It works with path strings rather than first-class path objects, automatically adapting to the host platform or a specific explicitly chosen style.
AI-written summary of version 1.9.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to manipulate file paths or URLs cross-platform in Dart.
- You want to join, split, or normalize path strings safely across Windows, POSIX, and the browser.
Skip it when
- You prefer strongly-typed path objects instead of string-based path handling.
Strengths
- Solid support for Windows, POSIX (Linux and Mac OS X), and the web.
- Well-tested and used by many Dart packages for high stability.
Weaknesses
- Treats paths as strings instead of first-class path objects.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:path/path.dart' as p;
void main() {
var fullPath = p.join('directory', 'file.txt');
}Alternatives
Packages that do the same job and could replace path.
- path_provider
If you need to find commonly used locations on the filesystem such as temporary or documents directories.
93Compare
Works with
Packages commonly used together with path: ones it builds on, ones built on it, and its own family.
- analyzerBuilt on pathPerforms static analysis of Dart code for tool integration and embedding.
- archiveBuilt on pathEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- stack_traceBuilt on pathProvides parsing, inspection, and readable formatting of Dart stack traces.
- globBuilt on pathA file and directory globbing library that supports Bash-style path matching and listing.
- ioBuilt on pathUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- dart_styleBuilt on pathProvides an API and CLI to format Dart source code automatically.
- coverageBuilt on pathCollects, manipulates, and formats code coverage data in Dart
- source_spanBuilt on pathStandard representation for source code locations, spans, and human-friendly error messages.