JavaScript implementation for RATS.
npm i rats-js
var RATS = require('rats')
var rats = new RATS('./rats')
rats.append({foo: 'bar'}, function (err) {})
rats.currentOffset // === 1
rats.get(0, function (err, data) {})
rats.range(0, 100, function (err, list) {})
Create a new RATS at path
. Options opts
include:
- maxSegmentSize: maximum size of a segment. default:5MB
Returns the current offset.
Append an object
to the RATS. you can specify the timestamp of this append with time
(unix time in seconds).
The index file currently in use.
The log file currently in use.
Get the data at offset
.
Get the data(s) in the range.
endTime
by default will be the timestamp of the last object in the RATS.
The MIT License