Socket
Socket
Sign inDemoInstall

discovery-swarm

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discovery-swarm - npm Package Compare versions

Comparing version 5.1.1 to 5.1.2

2

example.js

@@ -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

@@ -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 @@ })

})
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