Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crdt

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crdt - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

8

example/complex/server.js

@@ -7,3 +7,2 @@

var kv = require('kv')
var es = require('event-stream')

@@ -31,8 +30,5 @@ var app = connect()

else
s.pipe(docs[s.meta.type].createStream({wrapper: 'raw'}))
.pipe(s)
}))
.pipe(es.log('>>'))
.pipe(sock)
s.pipe(docs[s.meta.type].createStream({wrapper: 'raw'})).pipe(s)
})).pipe(sock)
}).install(app.listen(3000), '/shoe')

@@ -5,3 +5,3 @@ {

"description": "Commutative Replicated Data Types for easy distributed/collaborative apps",
"version": "3.1.2",
"version": "3.1.3",
"homepage": "http://github.com/dominictarr/crdt",

@@ -19,3 +19,3 @@ "repository": {

"between": "0.0.0",
"scuttlebutt": "~2.2.0"
"scuttlebutt": "~4.0.0"
},

@@ -22,0 +22,0 @@ "devDependencies": {

@@ -13,5 +13,2 @@ 'use strict';

var ds = crdt.createStream(doc)
var hs = crdt.createStream(hoc)
var piped = false

@@ -23,2 +20,4 @@ var consistent = false

console.log('pipe')
var ds = crdt.createStream(doc)
var hs = crdt.createStream(hoc)
ds.pipe(hs).pipe(ds)

@@ -25,0 +24,0 @@ }, Math.random()*10)

@@ -10,6 +10,2 @@ var crdt = require('..')

/*function test (name, test) {
exports[name] = test
}*/
var next = process.nextTick

@@ -26,4 +22,5 @@

randomUpdates(a)
console.log('simple')
a.createReadStream({wrapper: 'raw'})
console.log('simple')
a.createReadStream({wrapper: 'raw', tail: false})
.pipe(es.writeArray(function (err, array) {

@@ -60,3 +57,2 @@ console.log('array', array)

test('JSON', function (t) {

@@ -67,4 +63,4 @@

randomUpdates(a)
console.log('simple')
a.createReadStream({wrapper: 'json'})
a.createReadStream({wrapper: 'json', tail: false})
.pipe(es.writeArray(function (err, array) {

@@ -71,0 +67,0 @@ console.log('array', array)

@@ -71,4 +71,6 @@ 'use strict';

})
hoc.createStream({wrapper: 'json'}).pipe(doc.createStream({wrapper: 'json'}))
var hs
(hs = hoc.createStream({wrapper: 'json'}))
.pipe(doc.createStream({wrapper: 'json'}))
.pipe(hs)
hoc.add({id: 'thing', random: random })

@@ -90,4 +92,6 @@ }

//this should replicate only one document.
hoc.createStream({id: 'thing', wrapper: 'raw'})
var hs
(hs = hoc.createStream({id: 'thing', wrapper: 'raw'}))
.pipe(doc.createStream({id: 'thing', wrapper: 'raw'}))
.pipe(hs)

@@ -94,0 +98,0 @@ var thing = hoc.get('thing')

@@ -28,3 +28,3 @@ var crdt = require('..')

bs.pipe(as)
bs.pipe(as).pipe(bs)

@@ -31,0 +31,0 @@ randomUpdates(b)

@@ -17,5 +17,3 @@ var es = require('event-stream')

var a = new crdt.Doc()
var as = a.createStream()
var b = new crdt.Doc()
var bs = b.createStream()

@@ -57,2 +55,3 @@ a.sync = b.sync = true

var server = net.createServer(function (sock) {
var as = a.createStream()
toJSON(as, 'A>').pipe(sock).pipe(fromJSON(as, 'A<'))

@@ -83,2 +82,3 @@

var client
var bs = b.createStream()
toJSON(bs, 'B>').pipe(client = net.connect(6464)).pipe(fromJSON(bs, 'B<'))

@@ -88,2 +88,3 @@

try {
console.log('updated', a.toJSON(), b.toJSON())
assert.deepEqual(a.toJSON(), b.toJSON())

@@ -90,0 +91,0 @@ return allChanges <= 0

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc