@decentnetwork/peer 0.1.15 → 0.1.16

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.
Files changed (2) hide show
  1. package/dist/peer.js +7 -5
  2. package/package.json +1 -1
package/dist/peer.js CHANGED
@@ -890,11 +890,13 @@ export class Peer {
890
890
  }
891
891
  this.#tracePacket("rx", packet, { host: remote.address, port: remote.port });
892
892
  // TEMP: log every inbound UDP datagram so we can see if bootstraps reply at all
893
- try {
894
- const fs = require("fs");
895
- fs.appendFileSync("/tmp/decent-udp-rx.log", `${new Date().toISOString()} from=${remote.address}:${remote.port} firstByte=0x${packet[0]?.toString(16) ?? "??"} len=${packet.length}\n`);
896
- }
897
- catch { /* best-effort */ }
893
+ // Fire-and-forget — dynamic import in a sync handler.
894
+ import("fs").then((fs) => {
895
+ try {
896
+ fs.appendFileSync("/tmp/decent-udp-rx.log", `${new Date().toISOString()} from=${remote.address}:${remote.port} firstByte=0x${packet[0]?.toString(16) ?? "??"} len=${packet.length}\n`);
897
+ }
898
+ catch { /* best-effort */ }
899
+ }).catch(() => { });
898
900
  if (packet[0] === NET_PACKET_CRYPTO) {
899
901
  const opened = openToxDhtCryptoRequest(packet, this.#keyPair);
900
902
  if (!opened) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/peer",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Pure TypeScript port of Elastos Carrier (toxcore-derived) P2P messaging. DHT, onion routing, TCP relay, FlatBuffers app payloads, Express offline relay. Wire-compatible with iOS Beagle and the Carrier C SDK.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",