# npm-cli-dir

> Resolve the directory path where npm CLI is installed

Latest version **4.0.0** (published 2019-06-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install npm-cli-dir
pnpm add npm-cli-dir
yarn add npm-cli-dir
bun add npm-cli-dir
```

## 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 | 4.0.0 |
| Published | 2019-06-04 |
| First published | 2015-11-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Watanabe Shinnosuke |
| Maintainers | shinnn |
| Keywords | dir, directory, folder, path, npm, npm-cli, base, resolve, find, pinpoint, promise, promises, then, async, asynchronous, asynchronously |

## Links

- npm: https://www.npmjs.com/package/npm-cli-dir
- Repository: https://github.com/shinnn/npm-cli-dir
- Homepage: https://github.com/shinnn/npm-cli-dir#readme
- Issues: https://github.com/shinnn/npm-cli-dir/issues
- npm.io page: https://npm.io/package/npm-cli-dir

## Dependencies (2)

- [find-pkg-dir](https://npm.io/package/find-pkg-dir.md) ^2.0.0
- [npm-cli-path](https://npm.io/package/npm-cli-path.md) ^4.0.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

- 4.0.0 (latest) — 2019-06-04
- 3.0.1 — 2018-08-14
- 3.0.0 — 2018-06-08
- 3.0.0-0 — 2018-05-24
- 2.0.2 — 2018-01-29
- 2.0.1 — 2017-05-26
- 2.0.0 — 2016-06-19
- 1.0.0 — 2015-12-01
- 0.0.0 — 2015-11-18

## README

# npm-cli-dir

[![npm version](https://img.shields.io/npm/v/npm-cli-dir.svg)](https://www.npmjs.com/package/npm-cli-dir)
[![Build Status](https://travis-ci.com/shinnn/npm-cli-dir.svg?branch=master)](https://travis-ci.com/shinnn/npm-cli-dir)
[![codecov](https://codecov.io/gh/shinnn/npm-cli-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/npm-cli-dir)

A [Node.js](https://nodejs.org/) module to resolve a path of the directory where [npm CLI](https://github.com/npm/cli) is installed

```javascript
const npmCliDir = require('npm-cli-dir');

(async () => {
  const dir = await npmCliDir(); //=> '/usr/local/lib/node_modules/npm'
})();
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).

```
npm install npm-cli-dir
```

## API

```javascript
const npmCliDir = require('npm-cli-dir');
```

### npmCliDir()

Return: `Promise<string>`

```javascript
const {readdir} = require('fs').promises;
const npmCliDir = require('npm-cli-dir');

(async () => {
  await readdir(await npmCliDir());
  //=> ['.mailmap', '.npmignore', '.travis.yml', 'AUTHORS', 'CHANGELOG.md', ...]
})();
```

## License

[ISC License](./LICENSE) © 2017 - 2019 Watanabe Shinnosuke

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