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

hyperswarm

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperswarm - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

7

index.js

@@ -5,2 +5,3 @@ const { EventEmitter } = require('events')

const b4a = require('b4a')
const safetyCatch = require('safety-catch')

@@ -329,3 +330,7 @@ const PeerInfo = require('./lib/peer-info')

const topicString = b4a.toString(topic, 'hex')
if (this._discovery.has(topicString)) return this._discovery.get(topicString)
if (this._discovery.has(topicString)) {
const discovery = this._discovery.get(topicString)
discovery.refresh(opts).catch(safetyCatch)
return discovery
}
const discovery = new PeerDiscovery(this, topic, {

@@ -332,0 +337,0 @@ ...opts,

3

package.json
{
"name": "hyperswarm",
"version": "4.1.0",
"version": "4.1.1",
"description": "A distributed networking stack for connecting peers",

@@ -9,2 +9,3 @@ "dependencies": {

"events": "^3.3.0",
"safety-catch": "^1.0.2",
"shuffled-priority-queue": "^2.1.0"

@@ -11,0 +12,0 @@ },

@@ -478,2 +478,26 @@ const test = require('brittle')

test('rejoining with different client/server opts refreshes', async (t) => {
const { bootstrap } = await createTestnet(3, t.teardown)
const swarm1 = new Hyperswarm({ bootstrap })
const swarm2 = new Hyperswarm({ bootstrap })
const topic = Buffer.alloc(32).fill('hello world')
swarm1.join(topic, { client: true, server: false })
await swarm1.join(topic, { client: true, server: true }).flushed()
await swarm2
.on('connection', (conn) => conn.on('error', noop))
.join(topic, { client: true })
.flushed()
await swarm2.flush()
t.is(swarm2.connections.size, 1)
await swarm1.destroy()
await swarm2.destroy()
})
function noop () {}
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