splitPath()function

splitPath(path: PossiblePath): readonly string[]
ParamType
pathPossiblePath
Path to split (an array of segments is returned as-is). required
Return
readonly string[]
Array of path segments.

Get the "segments" in an absolute path.

Examples

splitPath("/a/b") // ["a", "b"]