An open API service indexing awesome lists of open source software.

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

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)