# jsonlz4-decompress

> Decompress FireFox jsonlz4 bookmark backup files

Latest version **0.0.3** (published 2019-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsonlz4-decompress
pnpm add jsonlz4-decompress
yarn add jsonlz4-decompress
bun add jsonlz4-decompress
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-11-29 |
| First published | 2019-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Tom Hiller |
| Maintainers | thrilleratplay |
| Keywords | jsonlz4, json, bookmarks, firefox, lz4 |

## Links

- npm: https://www.npmjs.com/package/jsonlz4-decompress
- Repository: https://github.com/thrilleratplay/node-jsonlz4-decompress
- Homepage: https://github.com/thrilleratplay/node-jsonlz4-decompress#readme
- Issues: https://github.com/thrilleratplay/node-jsonlz4-decompress/issues
- npm.io page: https://npm.io/package/jsonlz4-decompress

## Dependencies (2)

- [lz4](https://npm.io/package/lz4.md) ^0.6.3
- [commander](https://npm.io/package/commander.md) ^2.9.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.3 (latest) — 2019-11-29
- 0.0.2 — 2019-05-12

## README

JSON lz4 Decompress
=========================

A Node.js module and CLI application for decompressing a Firefox bookmark backup jsonlz4 file format into JSON.

## Node module

#### Installation
To install as a local module and include as a dependency:
```bash
npm install --save jsonlz4-decompress
```

#### Usage
```javascript
var jsonlz4 = require('jsonlz4-decompress');
var fs = require('fs');

// Open file into buffer
fs.readFile('/path/to/bookmarkbackups/back-up-date.jsonlz4', function(err, fileBuffer) {
  // decompress file buffer to JSON
  decompressedJson = jsonlz4(fileBuffer);

  // do something with the JSON
  console.log(decompressedJson);
});
```


## Commandline

#### Installation
To install as a command line application:
```bash
npm install jsonlz4-decompress -g
```
You may need to prefix the command with sudo.

#### Usage
```none
  Usage: index [options] <file>

  Decompress a Firefox bookmark backup jsonlz4 file format into JSON.

  Options:

    -h, --help    output usage information
    -p, --pretty  Pretty print JSON

```

Output is sent to `stdout`


## Technical stuff
Based on a [description snippet found here](https://www.reddit.com/r/firefox/comments/3offju/jsonlz4_file/)

`bytes 0-7`: Magic number when converted to a string `mozLz40` followed by a null charater.  
`bytes 8-11`: Uncompressed file size.  Little endian unsigned 32bit integer.  
`bytes 12-EOL`: LZ4 compressed blocked.

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