https://github.com/sdgluck/path-cwd
Get a path in the cwd
https://github.com/sdgluck/path-cwd
Last synced: 9 months ago
JSON representation
Get a path in the cwd
- Host: GitHub
- URL: https://github.com/sdgluck/path-cwd
- Owner: sdgluck
- License: mit
- Created: 2017-09-05T13:32:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-09T21:00:32.000Z (over 8 years ago)
- Last Synced: 2025-08-09T13:05:29.874Z (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-cwd
> Get a path in the cwd
Unlike the [`resolve-*`](https://github.com/sindresorhus/resolve-cwd) these modules allow resolution of non-module paths.
## Install
```sh
npm install --save path-cwd
```
```sh
yarn add path-cwd
```
## Import
```js
// ES2015
import cwd from 'path-cwd'
```
```js
// CommonJS
var cwd = require('path-cwd')
```
## Usage
### `cwd([path]) : String`
Get a path in the cwd.
- __path__ {String} _(optional)_ path to get in the cwd
Returns a string.
## Example
```js
import cwd from 'path-cwd'
cwd('pineapple') //=> C:/User/Spongebob Squarepants/projects/bikini-bottom/pineapple
```
## See also
- [`path-homedir`](https://github.com/sdgluck/path-homedir)
- [`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)