Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viniciusbo/mqtt-localforage-store
MQTT.js localForage Store for the browser
https://github.com/viniciusbo/mqtt-localforage-store
browser javascript js localforage mqtt store
Last synced: 19 days ago
JSON representation
MQTT.js localForage Store for the browser
- Host: GitHub
- URL: https://github.com/viniciusbo/mqtt-localforage-store
- Owner: viniciusbo
- Created: 2017-11-09T15:50:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T03:30:58.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T21:43:30.548Z (7 months ago)
- Topics: browser, javascript, js, localforage, mqtt, store
- Language: JavaScript
- Size: 979 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MQTT.js localForage Store for the browser
[![Build Status](https://api.travis-ci.org/viniciusbo/mqtt-localforage-store.svg?branch=master)](https://travis-ci.org/viniciusbo/mqtt-localforage-store)
## Installation
### NPM
```sh
yarn add mqtt-localforage-store localforage
# or
npm install --save mqtt-localforage-store
```### Compile yourself
```sh
git clone [email protected]:viniciusbo/mqtt-localforage-store.git && cd mqtt-localforage-store
yarn # or npm install
npm run build
cd /dist
```Distribution bundles are located in `/dist` folder. The build exposes the `MQTTLocalForageStore` globally.
## Usage
```javascript
import localForage from 'localforage';
import Store as MQTTLocalForageStore from 'mqtt-localforage-store';// Make your own localForage instances
const incomingDb = localForage.createInstance({ name: 'incomingPackets' });
const outgoingDb = localForage.createInstance({ name: 'outgoingPackets' });const incomingStore = MQTTLocalForageStore(incomingDb);
const outgoingStore = MQTTLocalForageStore(outgoingDb);mqtt.connect({
// ...
incomingStore,
outgoingStore,
});
```## Test
```sh
yarn # or npm install
npm run test
```