Convert an absolute path to tilde path: /Users/sindresorhus/dev => ~/dev
JavaScript
Latest commit c323a7e Apr 12, 2016 @sindresorhus 1.2.0
Permalink
Failed to load latest commit information.
.editorconfig meta tweaks Apr 12, 2016
.gitattributes init Jan 9, 2014
.gitignore init Jan 9, 2014
.travis.yml meta tweaks Apr 12, 2016
index.js Only tildify home at the beginning of a path (#6) Apr 12, 2016
license tweaks Aug 3, 2014
package.json 1.2.0 Apr 12, 2016
readme.md meta tweaks Apr 12, 2016
test.js meta tweaks Apr 12, 2016

readme.md

tildify Build Status

Convert an absolute path to a tilde path: /Users/sindresorhus/dev~/dev

Install

$ npm install --save tildify

Usage

const tildify = require('tildify');

tildify('/Users/sindresorhus/dev');
//=> '~/dev'

Related

See untildify for the inverse.

License

MIT © Sindre Sorhus