open-index/open-npm huggingface dataset:
npm package: @mingderwang/peer-discovery
Description: ``` import { test, expect } from 'bun:test'; import { PeerDiscovery } from './PeerDiscovery.ts';
Latest version: 0.0.1

# PeerDiscovery

```
import { test, expect } from 'bun:test';
import { PeerDiscovery } from './PeerDiscovery.ts';

const discovery = new PeerDiscovery({
  peerId: 'my-peer-id',
  port: 8080,
  enableMDNS: true,
  bootstrapPeers: ['127.0.0.1:8081']
});

discovery.on('peer:discovered', (peer) => {
  console.log('New peer discovered:', peer.id);
});

await discovery.start();
const running = discovery.running;  
console.log(running)
```