path library

path library

path library

Function

path standard library for path text concatenation, normalization and filename splitting, does not access file system state.

API List

APIDescription
path.joinJoin the current path and subsequent path fragments.
path.dirnameReturns the parent directory path.
path.basenameReturn the file name.
path.filenameReturns the filename without extension.
path.extensionReturn the extension name.
path.normalizeNormalize path text.
path.is_absoluteDetermine whether the path is an absolute path.
path.is_relativeDetermine whether the path is a relative path.
path.to_stringReturn the current path text.

Examples

Notes

  • path only processes path text; please use the fs library to see if the file exists.