@jamesarlow/tilde-path
v0.0.3
Published
`Path` upgraded to support resolve/normalize user home path strings.
Downloads
2
Readme
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'