Skip to content

Instantly share code, notes, and snippets.

@juliangruber
Created November 12, 2012 21:31
Show Gist options
  • Save juliangruber/4062042 to your computer and use it in GitHub Desktop.
Save juliangruber/4062042 to your computer and use it in GitHub Desktop.
var timeseries = require('timeseries')
var ts = timeseries('./db')
var s = ts.createStream()
s.pipe(net.connect(3000)).pipe(s)
// display chart with realtime updates!
ts('the-id').createRangeStream(start).pipe(listener)
ts('the-id').get(1337, cb)
// set at given date
ts('the-id').add(1337, '324,345,456,657')
// set at current date
ts('the-id').add('324,345,456,657')
// store min-max
ts.on('update', function (id, k, v) {
// logic...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment