# win-user-installed-npm-cli-path

> Resolve the path of `npm-cli.js` included in the user-installed npm on Windows

Latest version **4.0.0** (published 2019-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install win-user-installed-npm-cli-path
pnpm add win-user-installed-npm-cli-path
yarn add win-user-installed-npm-cli-path
bun add win-user-installed-npm-cli-path
```

## 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-05-31 |
| First published | 2015-11-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Watanabe Shinnosuke |
| Maintainers | shinnn |
| Keywords | npm, npm-cli, path, exe, executable, resolve, find, promise, promises, async |

## Links

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

## 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-05-31
- 3.0.0-0 (next) — 2018-05-10
- 3.0.1 — 2019-05-31
- 3.0.0 — 2018-05-16
- 3.0.0-1 — 2018-05-13
- 2.0.4 — 2018-05-08
- 2.0.3 — 2018-05-07
- 2.0.2 — 2017-11-21
- 2.0.1 — 2017-06-07
- 2.0.0 — 2016-06-17
- 1.0.0 — 2015-11-12
- 0.0.0 — 2015-11-08

## README

# win-user-installed-npm-cli-path

[![npm version](https://img.shields.io/npm/v/win-user-installed-npm-cli-path.svg)](https://www.npmjs.com/package/win-user-installed-npm-cli-path)
[![Build Status](https://travis-ci.com/shinnn/win-user-installed-npm-cli-path.svg?branch=master)](https://travis-ci.com/shinnn/win-user-installed-npm-cli-path)
[![Build status](https://ci.appveyor.com/api/projects/status/2sp4jxe2rp48lnk2/branch/master?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/win-user-installed-npm-cli-path/branch/master)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/win-user-installed-npm-cli-path.svg)](https://coveralls.io/github/shinnn/win-user-installed-npm-cli-path)

Resolve the path of [`npm-cli.js`][npm-cli] included in [user-installed](https://docs.npmjs.com/getting-started/installing-node#updating-npm) [npm](https://www.npmjs.com/) on [Windows](https://www.microsoft.com/windows)

```javascript
const winUserInstalledNpmCliPath = require('win-user-installed-npm-cli-path');

(async () => {
  const cliPath = await winUserInstalledNpmCliPath();
  //=> 'C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
  });
})();
```

## Installation

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

```
npm install win-user-installed-npm-cli-path
```

## API

```javascript
const winUserInstalledNpmCliPath = require('win-user-installed-npm-cli-path');
```

### winUserInstalledNpmCliPath()

Return: `Promise<string>`

It resolves the path of [`npm-cli.js`][npm-cli] included in the user-installed [`npm` CLI](https://github.com/npm/npm) on Windows. *"User-installed"* means that it has been installed with [`npm install --global npm`](https://docs.npmjs.com/getting-started/installing-node#updating-npm) command by the user, and it might be located on the path different from where the default Node.js-bundled npm has been installed.

It uses global [`prefix`](https://docs.npmjs.com/files/folders#prefix-configuration) [config](https://docs.npmjs.com/misc/config#prefix) as a base path for searching npm CLI location.

```javascript
// npm config set prefix tmp --global

(async () => {
  await winUserInstalledNpmCliPath();
  //=> 'C:\projects\your_project\tmp\node_modules\npm\bin\npm-cli.js'
})();
```

## For [POSIX](http://standards.ieee.org/develop/wg/POSIX.html)

Use [real-executable-path](https://github.com/shinnn/real-executable-path) instead.

```javascript
const realExecutablePath = require('real-executable-path');

(async () => {
  await realExecutablePath('npm');
  //=> '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
})();
```

## License

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

[npm-cli]: https://github.com/npm/npm/blob/master/bin/npm-cli.js

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