NeDB persistence for Aedes.
npm install aedes-persistence-nedb


![Dependencies]()



[Aedes][aedes] persistence, backed by [NeDB][nedb].
See [aedes-persistence][persistence] for the full API, and [Aedes][aedes] for usage.
``sh`
npm i aedes aedes-persistence-nedb --save
Creates a new instance of aedes-persistence-nedb.
Accepts an options object to override defaults.
`js`
var NedbPersistence = require('aedes-persistence-nedb');
var persistence = new NedbPersistence({
path: './db' // defaults to './data',
prefix: 'mqtt' // defaults to ''
});
Creates a new Aedes instance that persists to NeDB. Connect to this instance with a MQTT client to see it working.
`js
var NedbPersistence = require('aedes-persistence-nedb');
var Aedes = require('aedes');
var net = require('net');
var db = new NedbPersistence();
var aedes = Aedes({ persistence: db });
var server = net.createServer(aedes.handle);
var port = 1883;
server.listen(port, function () {
console.log('server listening on port', port);
});
``
Osmond van Hemert


See the CONTRIBUTING file for details.
MIT
[aedes]: https://github.com/mcollina/aedes
[persistence]: https://github.com/mcollina/aedes-persistence
[nedb]: https://github.com/louischatriot/nedb