seal-counter-storage
seal-counter-storage manages handling of counters persisted in a MongoDB.
Installation
$ npm install seal-counter-storage
Quick start
First you need to add a reference to seal-counter-storage within your application.
var counterStorage = ;
Then you can connect to a MongoDB. For that call the connect
function and provide the database's connection string using the url
property:
counterStorage
Optionally, you may also specify the number of connection retries:
counterStorage
Get next counter value
To get the next counter value call the getCounter
function and provide at least its name and a callback.
Optionally you can provide the increment as second argument, default increment is 1
.
storage;
With increment:
storage;
Running the build
To build this module use roboter.
$ bot