3.0.2 • Published 3 years ago

@particle/untildify v3.0.2

Weekly downloads
57
License
UNLICENSED
Repository
-
Last release
3 years ago

@particle/untildify

Expand the ~ shortcut at the start of a path into the current user's $HOME directory

Installation

npm install @particle/untildify --save

API

@particle/untildify


module.exports(pathStr) ⇒ string

Expand ~ at the start of a path to an absolute path to the user's $HOME directory

Kind: Exported function
Returns: string - An absolute path to a location within the user's $HOME directory or the original path if ~ character is not found

ParamTypeDescription
pathStrstringPath string to operate on

Example

const pathToBashRc = untildify('~/.bashrc');
console.log(pathToBashRc); // -> '/Users/me/.bashrc'

NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests

3.0.2

3 years ago

2.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.1

4 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago