Comparing version 6.12.1 to 6.13.0
@@ -178,4 +178,6 @@ const { EventEmitter } = require('events') | ||
toArray () { | ||
return this.nodes.toArray().map(({ host, port }) => ({ host, port })) | ||
toArray (opts) { | ||
const limit = (opts && opts.limit) | ||
if (limit === 0) return [] | ||
return this.nodes.toArray(limit).map(({ host, port }) => ({ host, port })) | ||
} | ||
@@ -182,0 +184,0 @@ |
{ | ||
"name": "dht-rpc", | ||
"version": "6.12.1", | ||
"version": "6.13.0", | ||
"description": "Make RPC calls over a Kademlia based DHT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -342,5 +342,5 @@ # dht-rpc | ||
#### `node.toArray()` | ||
#### `node.toArray([options])` | ||
Get the routing table peers out as an array of `{ host, port }` | ||
Get the routing table peers out as an array of `{ host, port }`. Use `options.limit` to get a subset. | ||
@@ -347,0 +347,0 @@ #### `node.addNode({ host, port })` |
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
62985
1441