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.
Parameters:
pathstring Path to test
Returns:
boolean trueif path is absolute -
util.path.normalize(path){ string }
-
Normalizes the specified path.
Parameters:
pathstring Path to normalize
Returns:
string Normalized path -
util.path.resolve(originPath, includePath, alreadyNormalized){ string }
-
Resolves the specified include path against the specified origin path.
Parameters:
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:
string Path to the include file