path

native module

Pure path-string manipulation (no I/O). import "path". All infallible except abs, which follows the (value, err) convention.

path.join(..parts: string) => string

Join segments into one cleaned path.

path.dir(p: string) => string

Directory portion of a path.

path.base(p: string) => string

Final element of a path.

path.ext(p: string) => string

File extension, including the leading dot.

path.abs(p: string) => (string, string?)

Absolute form; errs if resolution fails.

On this page