@guanghechen/helper-path
Utilities to handle url path and file path.
Install
-
npm
npm install --save @guanghechen/helper-path
-
yarn
yarn add @guanghechen/helper-path
Usage
Name | Description |
---|---|
FilepathResolver |
Resolve relative / absolute path under the given rootDir. |
absoluteOfWorkspace |
Calc absolute filepath of p under the workspace. |
findNearestFilepath |
Find a nearest file matched the predicate from the given directory. |
locateNearestFilepath |
Locate a nearest target file path from the given directory. |
normalizeUrlPath |
Normalize url path. |
relativeOfWorkspace |
Calc relative filepath to workspace. |