Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 292 Bytes

README.md

File metadata and controls

14 lines (11 loc) · 292 Bytes

online-lag

Stores last X values of a data stream

Usage

const Lag = require('online-lag')
const lag = Lag(4)

;[1, 2, 3, [4, 5], 6, 7].forEach(v => {
  lag(v) // accepts arrays too
})

console.log('Values; total number of observations: ', l.values, l.n) // [7,6,5,4] 7