https://github.com/sdgluck/path-homedir
Get a path in the user home directory
https://github.com/sdgluck/path-homedir
Last synced: 9 months ago
JSON representation
Get a path in the user home directory
- Host: GitHub
- URL: https://github.com/sdgluck/path-homedir
- Owner: sdgluck
- License: mit
- Created: 2017-09-05T13:26:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-09T20:59:14.000Z (over 8 years ago)
- Last Synced: 2025-08-06T12:49:01.372Z (10 months ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# path-homedir
> Get a path in the user home directory
Unlike the [`resolve-*`](https://github.com/sindresorhus/resolve-cwd) these modules allow resolution of non-module paths.
## Install
```sh
npm install --save path-homedir
```
```sh
yarn add path-homedir
```
## Import
```js
// ES2015
import homedir from 'path-homedir'
```
```js
// CommonJS
var homedir = require('path-homedir')
```
## Usage
### `homedir([path]) : String`
Get a path in the user's home directory.
- __path__ {String} _(optional)_ path to get in the home directory
Returns a string.
## Example
```js
import homedir from 'path-homedir'
homedir('pineapple') //=> C:/User/Spongebob Squarepants/pineapple
```
## See also
- [`path-cwd`](https://github.com/sdgluck/path-cwd)
- [`path-__dirname`](https://github.com/sdgluck/path-__dirname)
## Contributing
All pull requests and issues welcome!
If you're not sure how, check out the [great video tutorials on egghead.io](http://bit.ly/2aVzthz)!
## License
MIT © [Sam Gluck](https://github.com/sdgluck)