Skip to content

Commit

Permalink
use os-homedir ponyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 13, 2015
1 parent 23decff commit fab6d23
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
@@ -1,4 +1,3 @@
# editorconfig.org
root = true

[*]
Expand All @@ -8,7 +7,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
[{package.json,*.yml}]
indent_style = space
indent_size = 2

Expand Down
1 change: 0 additions & 1 deletion .jshintrc
Expand Up @@ -2,7 +2,6 @@
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"immed": true,
"newcap": true,
Expand Down
5 changes: 3 additions & 2 deletions index.js
@@ -1,6 +1,7 @@
'use strict';
var userHome = require('user-home');
var osHomedir = require('os-homedir');
var home = osHomedir();

module.exports = function (str) {
return str.replace(userHome, '~');
return str.replace(home, '~');
};
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -7,7 +7,7 @@
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
Expand All @@ -30,9 +30,9 @@
"unexpand"
],
"dependencies": {
"user-home": "^1.0.0"
"os-homedir": "^1.0.0"
},
"devDependencies": {
"ava": "0.0.3"
"ava": "0.0.4"
}
}
4 changes: 2 additions & 2 deletions readme.md
Expand Up @@ -5,7 +5,7 @@

## Install

```sh
```
$ npm install --save tildify
```

Expand All @@ -16,7 +16,7 @@ $ npm install --save tildify
var tildify = require('tildify');

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


Expand Down

0 comments on commit fab6d23

Please sign in to comment.