@jamesarlow/tilde-path
Version:
`Path` upgraded to support resolve/normalize user home path strings.
30 lines (19 loc) • 584 B
Markdown
# tilde-path
*Node Path with support for leading tilde home strings*
## Overview
Developers and users shouldn't have to overthink whether tilde strings are supported in a given context.
This module patches the original `path` module so that leading tilde strings are handled by resolve and normalize.
## Installation
```
npm install @jamesarlow/tilde-path
```
## Usage
```
const path = require('tilde-path')
path.resolve('~')
// == os.homedir()
path.resolve('~', 'Documents')
// == os.homedir() + '/Documents'
path.resolve('~/Pictures')
// == os.homedir() + '/Pictures'
```