New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

k-rpc

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

k-rpc - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

15

index.js

@@ -94,4 +94,2 @@ var socket = require('k-rpc-socket')

var self = this
var i = 0
var stop = false

@@ -101,15 +99,8 @@ var missing = nodes.length

send()
function send () {
for (; i < nodes.length; i++) {
if (self.socket.inflight >= self.concurrency || stop) return
if (message.a) message.a.token = nodes[i].token
self._query(nodes[i], message, done)
}
for (var i = 0; i < nodes.length; i++) {
if (message.a) message.a.token = nodes[i].token
this._query(nodes[i], message, done)
}
function done (err, res, peer) {
send()
if (!err) hits++

@@ -116,0 +107,0 @@ if (!err && !stop) {

2

package.json
{
"name": "k-rpc",
"version": "1.0.0",
"version": "1.0.1",
"description": "Low-level implementation of the k-rpc protocol used the BitTorrent DHT.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -87,2 +87,11 @@ # k-rpc

You can return `false` from onreply to stop the query. This is useful if you are only looking for a single peer for example.
``` js
function onreply(message, node) {
console.log('will only fire once')
return false
}
```
#### `rpc.query(node, query, callback)`

@@ -89,0 +98,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