kademlia-routing-table 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ name: Build Status
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ jobs:
10
+ build:
11
+ strategy:
12
+ matrix:
13
+ node-version: [lts/*]
14
+ os: [ubuntu-latest, macos-latest, windows-latest]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Use Node.js ${{ matrix.node-version }}
19
+ uses: actions/setup-node@v3
20
+ with:
21
+ node-version: ${{ matrix.node-version }}
22
+ - run: npm install
23
+ - run: npm test
package/README.md CHANGED
@@ -6,8 +6,6 @@ XOR distance based routing table used for P2P networks such as a Kademlia DHT.
6
6
  npm install kademlia-routing-table
7
7
  ```
8
8
 
9
- [![build status](https://travis-ci.org/mafintosh/kademlia-routing-table.svg?branch=master)](https://travis-ci.org/mafintosh/kademlia-routing-table)
10
-
11
9
  Similar to k-buckets, but implemented using the simplifications described in https://github.com/ethereum/wiki/wiki/Kademlia-Peer-Selection
12
10
 
13
11
  To understand the concept behind peer routing, DHTs, and the terms used here,
package/index.js CHANGED
@@ -114,7 +114,7 @@ class Row extends EventEmitter {
114
114
 
115
115
  if (c === 0) {
116
116
  this.nodes[m] = node
117
- return
117
+ return true
118
118
  }
119
119
 
120
120
  if (c < 0) r = m - 1
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "kademlia-routing-table",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "XOR based routing table used for P2P networks such as a Kademlia DHT.",
5
5
  "main": "index.js",
6
- "dependencies": {},
6
+ "imports": {
7
+ "events": {
8
+ "bare": "bare-events",
9
+ "default": "events"
10
+ }
11
+ },
12
+ "dependencies": {
13
+ "bare-events": "^2.2.0"
14
+ },
7
15
  "devDependencies": {
8
- "standard": "^16.0.3",
9
- "tape": "^5.2.2"
16
+ "brittle": "^3.3.2",
17
+ "standard": "^17.1.0"
10
18
  },
11
19
  "scripts": {
12
- "test": "standard && tape test.js"
20
+ "test": "standard && brittle test.js"
13
21
  },
14
22
  "keywords": [
15
23
  "kademlia",
@@ -23,12 +31,12 @@
23
31
  ],
24
32
  "repository": {
25
33
  "type": "git",
26
- "url": "https://github.com/mafintosh/xor-routing-table.git"
34
+ "url": "https://github.com/mafintosh/kademlia-routing-table.git"
27
35
  },
28
36
  "author": "Mathias Buus (@mafintosh)",
29
37
  "license": "MIT",
30
38
  "bugs": {
31
- "url": "https://github.com/mafintosh/xor-routing-table/issues"
39
+ "url": "https://github.com/mafintosh/kademlia-routing-table/issues"
32
40
  },
33
- "homepage": "https://github.com/mafintosh/xor-routing-table"
41
+ "homepage": "https://github.com/mafintosh/kademlia-routing-table"
34
42
  }
package/test.js CHANGED
@@ -1,14 +1,13 @@
1
- const tape = require('tape')
1
+ const test = require('brittle')
2
2
  const { randomBytes } = require('crypto')
3
3
  const RoutingTable = require('./')
4
4
 
5
- tape('basic', function (assert) {
5
+ test('basic', function (assert) {
6
6
  const table = new RoutingTable(id())
7
7
  const node = { id: id() }
8
8
 
9
9
  assert.ok(table.add(node))
10
- assert.same(table.closest(id()), [node])
11
- assert.end()
10
+ assert.alike(table.closest(id()), [node])
12
11
  })
13
12
 
14
13
  function id () {
package/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - '8'
4
- - '10'