path library
path library
Function
path standard library for path text concatenation, normalization and filename splitting, does not access file system state.
API List
| API | Description |
|---|---|
| path.join | Join the current path and subsequent path fragments. |
| path.dirname | Returns the parent directory path. |
| path.basename | Return the file name. |
| path.filename | Returns the filename without extension. |
| path.extension | Return the extension name. |
| path.normalize | Normalize path text. |
| path.is_absolute | Determine whether the path is an absolute path. |
| path.is_relative | Determine whether the path is a relative path. |
| path.to_string | Return the current path text. |
Examples
result = path('root').join('docs', 'index.md') // Output: root/docs/index.md print result
Notes
- path only processes path text; please use the fs library to see if the file exists.