# blizzard-product-parser

> A tool for parsing Blizzard product on your system.

Latest version **1.0.1** (published 2019-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install blizzard-product-parser
pnpm add blizzard-product-parser
yarn add blizzard-product-parser
bun add blizzard-product-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.1 |
| Published | 2019-03-27 |
| First published | 2019-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 202 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| Author | Tinko |
| Maintainers | tinko |
| Keywords | Blizzard, Battle.net |

## Links

- npm: https://www.npmjs.com/package/blizzard-product-parser
- Repository: https://github.com/TinkoLiu/blizzard-product-parser
- Homepage: https://github.com/TinkoLiu/blizzard-product-parser#readme
- Issues: https://github.com/TinkoLiu/blizzard-product-parser/issues
- npm.io page: https://npm.io/package/blizzard-product-parser

## Dependencies (1)

- [protobufjs](https://npm.io/package/protobufjs.md) ^6.8.8

## Recent versions

- 1.0.1 (latest) — 2019-03-27
- 1.0.0 — 2019-03-27

## README

# Blizzard Product Parser
A tool for parsing Blizzard Battle.net `product.db` file.

## Install
With yarn:

`yarn add blizzard-product-parser`

Or using npm:

`npm install blizzard-product-parser`

## Usage

### Contructing
```
import Parser from 'blizzard-product-parser'
const parser = new Parser()
```
`Parser()` will constructed with the default `product.db` path of your system ( Windows or macOS only ).

If you want to set the path manually, you can either get it done by:

`const parser = new Parser('/your/path/to/product.db')`

Or

```
const parser = new Parser()
parser.setPath('/your/path/to/product.db')
```

If you don't set the path and your system is not Windows or macOS, an error will be throwed since the path will be `null`.

### Decode a `product.db`
Simply call `parser.decode()` and it will be done.

An error will be throwed if `product.db` does not exist at your path.

Following functions needs you to `decode()` first, or it will throw an error.

### Get list of installed products
`parser.getProducts()` will return the **uid** of all install products in array.

### Get installed path of a determined product
`parser.getInstallPath(uid)`

If uid is invalid or not installed, this will return `false`.

### Get raw decoded string
`parser.getRaw()` will return an object with all the parsed raw data.

## Build
```
yarn
yarn build
```

## Credits
Protobuf description file was originally from [overtools/TACTLib](https://github.com/overtools/TACTLib/blob/master/TACTLib/Agent/Protobuf/ProtoDatabase.proto)

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