A minimal path module to resolve Unix, Windows and URL paths alike.
Methods
-
util.path.isAbsolute(path){ boolean }
-
Tests if the specified path is absolute.
Name Type Description pathstring Path to test
Returns:
Type Description boolean trueif path is absolute -
util.path.normalize(path){ string }
-
Normalizes the specified path.
Name Type Description pathstring Path to normalize
Returns:
Type Description string Normalized path -
util.path.resolve(originPath, includePath, alreadyNormalized){ string }
-
Resolves the specified include path against the specified origin path.
Name Type Default Description originPathstring Path to the origin file
includePathstring Include path relative to origin path
alreadyNormalizedboolean false optional trueif both paths are already known to be normalizedReturns:
Type Description string Path to the include file