# cwd

> Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)

Latest version **0.10.0** (published 2016-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install cwd
pnpm add cwd
yarn add cwd
bun add cwd
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.0 |
| Published | 2016-06-05 |
| First published | 2014-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/cwd) |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | current, cwd, dir, directory, file, filepath, path, paths, process, process.cwd, resolve, resolved, working |

## Links

- npm: https://www.npmjs.com/package/cwd
- Repository: https://github.com/jonschlinkert/cwd
- Issues: https://github.com/jonschlinkert/cwd/issues
- npm.io page: https://npm.io/package/cwd

## Dependencies (2)

- [find-pkg](https://npm.io/package/find-pkg.md) ^0.1.2
- [fs-exists-sync](https://npm.io/package/fs-exists-sync.md) ^0.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.10.0 (latest) — 2016-06-05
- 0.9.1 — 2015-11-28
- 0.9.0 — 2015-11-28
- 0.8.4 — 2015-10-20
- 0.8.3 — 2015-10-20
- 0.8.2 — 2015-10-20
- 0.8.1 — 2015-10-20
- 0.8.0 — 2015-08-21
- 0.7.0 — 2015-07-20
- 0.6.0 — 2015-03-16
- 0.5.1 — 2015-03-05
- 0.5.0 — 2015-03-03
- 0.4.0 — 2014-12-01
- 0.3.7 — 2014-07-06
- 0.3.6 — 2014-07-06
- … 10 more at https://npm.io/package/cwd/versions

## README

# cwd [![NPM version](https://img.shields.io/npm/v/cwd.svg?style=flat)](https://www.npmjs.com/package/cwd) [![NPM downloads](https://img.shields.io/npm/dm/cwd.svg?style=flat)](https://npmjs.org/package/cwd) [![Build Status](https://img.shields.io/travis/jonschlinkert/cwd.svg?style=flat)](https://travis-ci.org/jonschlinkert/cwd)

Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install cwd --save
```

## Usage

```js
var cwd = require('cwd');
cwd();
cwd('one/two.js');
cwd('one', 'two.js');
cwd(['one', 'two.js']);
```

## Related projects

You might also be interested in these projects:

* [global-modules](https://www.npmjs.com/package/global-modules): The directory used by npm for globally installed npm modules. | [homepage](https://github.com/jonschlinkert/global-modules "The directory used by npm for globally installed npm modules.")
* [global-paths](https://www.npmjs.com/package/global-paths): Returns an array of unique "global" directories based on the user's platform and environment. The… [more](https://github.com/jonschlinkert/global-paths) | [homepage](https://github.com/jonschlinkert/global-paths "Returns an array of unique "global" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.")
* [global-prefix](https://www.npmjs.com/package/global-prefix): Get the npm global path prefix. | [homepage](https://github.com/jonschlinkert/global-prefix "Get the npm global path prefix.")
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.")
* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.")
* [relative](https://www.npmjs.com/package/relative): Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file… [more](https://github.com/jonschlinkert/relative) | [homepage](https://github.com/jonschlinkert/relative "Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file, and directory-to-directory.")

## Contributing

This document was generated by [verb](https://github.com/verbose/verb), please don't edit directly. Any changes to the readme must be made in [.verb.md](.verb.md). See [Building Docs](#building-docs).

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/cwd/issues/new).

## Building docs

Generate readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install -g verb verb-readme-generator && verb
```

## Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

## Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/cwd/blob/master/LICENSE).

***

_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on June 05, 2016._

---
_Source: https://npm.io/package/cwd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
