Name: seq-save
Owner: npm
Description: save a sequence # to a configurable backend (etcd, files, etc.)
Created: 2017-10-24 22:11:55.0
Updated: 2017-10-27 19:15:57.0
Pushed: 2017-10-25 21:30:31.0
Homepage: null
Size: 47
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Save CouchDB sequence #s to a configurable backend. This allows you to resume CouchDB replication from the point where you left off.
see also: changes-stream.
This is a replacement to seq-file
, adding
support for additional backends.
path
, opts
): where path
is the path on disk to save the file
to or the key to use for an alternative backend, such as etcd. Returns a new
sequence saving instance.<Promise>
save.save(sequence
): save the sequence
to the configured backend.
Returns a Promise which will resolve once the value is saved.<Promise>
save.read(): Returns a Promise that will resolve with the
current sequence #.To save sequence files to the filesystem, simply provide the following configuration:
t SeqSave = require('seq-save')
t seq = new SeqSave('my-sequence.seq', {
pe: 'file'
It's worth noting that file
is the default backend, so you can also
simply provide an empty configuration object..
To save sequence files to etcd, simply provide the following configuration:
t Save = require('seq-save')
t seq = new SeqSave('my-sequence.seq', {
pe: 'etcd',
st: 'http://127.0.0.1:2379'