Package Exports
- tilde-path
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tilde-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tilde-path
Resolve a path into an absolute path, using tilde (~) if possible
// On /Users/shinnn/project
const tildePath = require('tilde-path');
tildePath('foo'); //=> '~/project/foo'
tildePath('foo/bar'); //=> '~/project/foo/bar'
tildePath('../'); //=> '~'Installation
npm install tilde-pathAPI
const tildePath = require('tilde-path');tildePath(path)
path: string
Return: string
On a non-Windows environment,
- Resolves a given path into an absolute path if it's relative
- Replaces the home directory path with
~
On Windows, it just calls path.win32.resolve because Windows doesn't support tilde home path.
// On POSIX
tildePath('my/dir'); //=> '~/my/dir'
// On Windows
tildePath('my/dir'); //=> 'C:\\Users\\shinnn\\my\\dir'License
ISC License © 2018 Shinnosuke Watanabe