# mqtt-level-store

> Store your in-flight mqtt packets in Level

Latest version **3.1.0** (published 2021-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install mqtt-level-store
pnpm add mqtt-level-store
yarn add mqtt-level-store
bun add mqtt-level-store
```

## 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 | 3.1.0 |
| Published | 2021-02-12 |
| First published | 2015-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Matteo Collina |
| Maintainers | matteo.collina |
| Keywords | mqtt, level, levelup, store |

## Links

- npm: https://www.npmjs.com/package/mqtt-level-store
- Repository: https://github.com/mcollina/mqtt-level-store
- Homepage: https://github.com/mcollina/mqtt-level-store#readme
- Issues: https://github.com/mcollina/mqtt-level-store/issues
- npm.io page: https://npm.io/package/mqtt-level-store

## Dependencies (3)

- [level](https://npm.io/package/level.md) ^5.0.0
- [msgpack5](https://npm.io/package/msgpack5.md) ^4.0.0
- [level-sublevel](https://npm.io/package/level-sublevel.md) ^6.6.1

## Recent versions

- 3.1.0 (latest) — 2021-02-12
- 3.0.0 — 2019-05-27
- 2.2.0 — 2018-09-18
- 2.1.0 — 2018-08-27
- 2.0.0 — 2017-09-05
- 1.1.0 — 2016-04-21
- 1.0.0 — 2015-03-11

## README

# MQTT.js Level Store

Persistent Store for in-flight MQTT.js packets. Works in Node and the Browser thanks to [level](http://npm.im/level).

## Installation

`npm install mqtt-level-store --save`

## Usage

```js
'use strict';

var mqtt = require('mqtt'),
  levelStore = require('mqtt-level-store');
  manager = levelStore('path/to/db');

var client = mqtt.connect({
  port: 8883,
  incomingStore: manager.incoming,
  outgoingStore: manager.outgoing
});

//// or
// var client = mqtt.connect('mqtt://test.mosca.io', {
//  port: 8883,
//  incomingStore: manager.incoming,
//  outgoingStore: manager.outgoing
//});

client.on('connect', function() {
  console.log('connected');
  client.publish('hello', 'world', {qos: 1}, function() {
    console.log('published');
    client.end();
  });
});
```

Note, `path/to/db` is a folder, not a file. Files will be created at the given path.

## License

MIT

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