Emit deltas in change over a stream

npm install delta-stream
1 downloads in the last day
16 downloads in the last week
58 downloads in the last month


Emit deltas in change over a stream

Data protocol

[key, value, sourceIdentifier, timestamp]

A delta-stream emits an array, where the first value is the key that has changed and the second value is the new value. This represents the delta in change on the object.

The third value is a source identifier. It's used to identify who created this delta

The fourth value is a time stamp which can be used for clever synchronization.


Create deltas that handle changes in state. Then create stream reprensentations of deltas

var Delta = require("delta-stream")

var delta1 = Delta()
    , delta2 = Delta()

var stream1 = delta1.createStream()
    , stream2 = delta2.createStream()

delta1.on("change:delta1", function (value) {
    console.log("[CHANGE:DELTA1]", value)

delta2.on("change:delta2", function (value) {
    console.log("[CHANGE:DELTA2]", value)


delta1.set("delta2", "hello")
delta2.set("delta1", "world")

Almost Compatible modules [NEED TO BE REFACTORED]



npm install delta-stream


  • Raynos

MIT Licenced

npm loves you