# npm-config-user-agent-parser

> Parser for process.env.npm_config_user_agent

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

## Install

```sh
npm install npm-config-user-agent-parser
pnpm add npm-config-user-agent-parser
yarn add npm-config-user-agent-parser
bun add npm-config-user-agent-parser
```

Provides the command `npm-config-user-agent-parser`.

## 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-07 |
| First published | 2018-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Cameron Hunter |
| Maintainers | cameronhunter |
| Keywords | npm_config_user_agent, parser |

## Links

- npm: https://www.npmjs.com/package/npm-config-user-agent-parser
- Repository: https://github.com/cameronhunter/npm-config-user-agent-parser
- Homepage: https://github.com/cameronhunter/npm-config-user-agent-parser#readme
- Issues: https://github.com/cameronhunter/npm-config-user-agent-parser/issues
- npm.io page: https://npm.io/package/npm-config-user-agent-parser

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.5.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-07-07

## README

# npm user agent parser

`npm` and `yarn` have a user agent string that contains version information.
This npm module parses the string into an object that is easily consumed on the
command-line or in JavaScript using the Node API.

An example of `npm`'s user agent on a Macbook Pro:

```
npm/6.1.0 node/v8.9.4 darwin x64
```

and an example of `yarn`'s on the same machine:

```
yarn/1.7.0 npm/? node/v8.9.4 darwin x64
```

## Installation

```bash
$ npm install npm-config-user-agent-parser
```

## Usage

```bash
$ npm-config-user-agent-parser 'yarn/1.7.0 npm/? node/v8.9.4 darwin x64'
yarn    1.7.0
node    8.9.4
platform        darwin
arch    x64
raw     yarn/1.7.0 npm/? node/v8.9.4 darwin x64
```

### Node API

```javascript
const parser = require('npm-config-user-agent-parser');

const parsed = parser(process.env.npm_config_user_agent);

console.log(parsed);
```

Outputs:

```json
{
  "yarn": {
    "raw": "1.7.0",
    "major": 1,
    "minor": 7,
    "patch": 0,
    "prerelease": [],
    "build": [],
    "version": "1.7.0"
  },
  "npm": null,
  "node": {
    "raw": "8.9.4",
    "major": 8,
    "minor": 9,
    "patch": 4,
    "prerelease": [],
    "build": [],
    "version": "8.9.4"
  },
  "platform": "darwin",
  "arch": "x64",
  "raw": "yarn/1.7.0 npm/? node/v8.9.4 darwin x64"
}
```

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