# path-__dirname

> Get a path in the __dirname

Latest version **2.1.0** (published 2017-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-__dirname
pnpm add path-__dirname
yarn add path-__dirname
bun add path-__dirname
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-09-09 |
| First published | 2017-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sam Gluck |
| Maintainers | sdgluck |
| Keywords | resolve, get, path, dir, __dirname, dirname |

## Links

- npm: https://www.npmjs.com/package/path-__dirname
- Repository: https://github.com/sdgluck/path-__dirname
- Homepage: https://github.com/sdgluck/path-__dirname#readme
- Issues: https://github.com/sdgluck/path-__dirname/issues
- npm.io page: https://npm.io/package/path-__dirname

## Dependencies (1)

- [clean-stack](https://npm.io/package/clean-stack.md) ^1.3.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

- 2.1.0 (latest) — 2017-09-09
- 2.0.2 — 2017-09-06
- 2.0.1 — 2017-09-06
- 2.0.0 — 2017-09-06

## README

# path-__dirname

> Get a path in the __dirname

__Note:__ this will not work for modules that are executed indirectly, for example testing engines like Jest.

Unlike the [`resolve-*`](https://github.com/sindresorhus/resolve-cwd) these modules allow resolution of non-module paths. 

## Install

```sh
npm install --save path-__dirname
```

```sh
yarn add path-__dirname
```

## Import

```js
// ES2015
import dirname from 'path-__dirname'
```

```js
// CommonJS
var dirname = require('path-__dirname')
```

## Usage

### `dirname([path]) : String`

Get a path in the dirname.

- __path__ {String} _(optional)_ path to get in the dirname

Returns a string.

## Example

```js
import dirname from 'path-__dirname'

dirname() === __dirname //=> true
dirname('pineapple') //=> C:/User/Spongebob Squarepants/projects/bikini-bottom/pineapple
```

## See also

- [`path-cwd`](https://github.com/sdgluck/path-cwd)
- [`path-homedir`](https://github.com/sdgluck/path-homedir)

## 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)

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