# npm-cli-version

> Get the currently installed `npm` CLI version

Latest version **1.0.0** (published 2018-07-10) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.0 |
| Published | 2018-07-10 |
| First published | 2017-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | npm, cli, version, command, semver, string, promise, async |

## Links

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

## Dependencies (1)

- [npm-cli-dir](https://npm.io/package/npm-cli-dir.md) ^3.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-07-10
- 0.5.0 — 2018-07-10
- 0.4.0 — 2018-06-22
- 0.3.0 — 2018-06-20
- 0.2.0 — 2017-06-05
- 0.1.0 — 2017-05-29
- 0.0.0 — 2017-05-29

## README

# npm-cli-version

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

Get the currently installed [`npm` CLI](https://github.com/npm/npm) version

```javascript
const npmCliVersion = require('npm-cli-version');

(async () => {
  await npmCliVersion(); //=> '5.5.1'
})();
```

Unlike the [prior](https://github.com/ngryman/npm-v) [arts](https://github.com/vvo/npm-version), it doesn't [execute](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) `npm --version` in a child process.

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install npm-cli-version
```

## API

```javascript
const npmCliVersion = require('npm-cli-version');
```

### npmCliVersion()

Return: `Promise<string>`

## Related projects

* [parse-npm-version](https://github.com/shinnn/parse-npm-version) — Similar to this module, but returns a `Promise` for a [node-semver](https://github.com/npm/node-semver) object instead
* [npm-cli-dir](https://github.com/shinnn/npm-cli-dir) — Resolve the directory path where `npm` CLI is installed. Used by this module.

## License

[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe

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