discovery-swarm
Advanced tools
Comparing version 5.1.1 to 5.1.2
@@ -9,3 +9,3 @@ var swarm = require('./') | ||
s.listen(10000 + id) | ||
s.join(Buffer('hello')) | ||
s.join(Buffer.from('hello')) | ||
@@ -12,0 +12,0 @@ s.on('connection', function (connection, info) { |
{ | ||
"name": "discovery-swarm", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"description": "A network swarm that uses discovery-channel to find peers", | ||
@@ -9,13 +9,13 @@ "main": "index.js", | ||
"connections": "^1.4.2", | ||
"debug": "^2.4.5", | ||
"debug": "^3.1.0", | ||
"discovery-channel": "^5.5.1", | ||
"length-prefixed-message": "^3.0.3", | ||
"pump": "^1.0.1", | ||
"pump": "^3.0.0", | ||
"to-buffer": "^1.0.1" | ||
}, | ||
"optionalDependencies": { | ||
"utp-native": "^1.7.0" | ||
"utp-native": "^1.7.2" | ||
}, | ||
"devDependencies": { | ||
"standard": "^6.0.7", | ||
"standard": "^11.0.1", | ||
"tape": "^4.4.0" | ||
@@ -22,0 +22,0 @@ }, |
@@ -33,3 +33,2 @@ # discovery-swarm | ||
Create a new swarm. Options include: | ||
```js | ||
@@ -159,3 +158,3 @@ { | ||
Listen on a specific port. Should be called before add | ||
Listen on a specific port. Should be called before join | ||
@@ -162,0 +161,0 @@ ## License |
25
test.js
@@ -12,2 +12,10 @@ var test = require('tape') | ||
test('swarm destroys immediately (utp)', function (t) { | ||
var s = swarm({dht: false, tcp: false}) | ||
s.destroy(function () { | ||
t.ok(true, 'destroyed ok') | ||
t.end() | ||
}) | ||
}) | ||
test('two swarms connect locally', function (t) { | ||
@@ -51,3 +59,3 @@ var pending = 0 | ||
b.destroy() | ||
t.same(data, Buffer('hello')) | ||
t.same(data, Buffer.from('hello')) | ||
t.end() | ||
@@ -76,6 +84,12 @@ }) | ||
connection.on('data', function (data) { | ||
a.destroy() | ||
b.destroy() | ||
t.same(data, Buffer('hello')) | ||
t.end() | ||
t.same(a._tcp, null, 'no tcp handler') | ||
t.same(b._tcp, null, 'no tcp handler') | ||
a.destroy(function () { | ||
t.pass('a destroy') | ||
b.destroy(function () { | ||
t.pass('b destroy') | ||
t.end() | ||
}) | ||
}) | ||
t.same(data, Buffer.from('hello')) | ||
}) | ||
@@ -204,2 +218,1 @@ }) | ||
}) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27298
635
162
- Removedpump@1.0.3(transitive)
Updateddebug@^3.1.0
Updatedpump@^3.0.0