npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@holesail/core

v1.0.0

Published

P2P core behind the Holesail CLI

Readme

@holesail/core

P2P core behind the Holesail CLI. Reverse proxy a local port peer-to-peer to anyone with an invite, over HyperDHT.

npm install @holesail/core

Works in Node.js and Bare.

Usage

On the machine running the service

const Holesail = require('@holesail/core')

const server = new Holesail({ server: true, port: 8080, host: '127.0.0.1' })
await server.ready()

console.log(server.info.invite) // hs_...

On the machine that wants to reach it

const Holesail = require('@holesail/core')

const client = new Holesail({ invite: 'hs_...' })
await client.ready()

// 127.0.0.1:8080 now tunnels to the server's port 8080

The client asks the server for its port, host and protocol when you don't pass them.

API

const hs = new Holesail([options])

Make a new Holesail server or client. Options include

{
  server: false, // set to true to run a server, otherwise it's a client
  port: 8080, // server: local port to expose. client: local port to listen on
  host: '127.0.0.1', // server: local host to expose. client: local host to bind to
  udp: false, // tunnel udp instead of tcp
  seed: '<hex>', // server only: 64 char hex seed, same seed gives the same invite
  invite: 'hs_...', // client only: invite of the server to connect to
  bootstrap: [], // custom dht bootstrap nodes, defaults to the public network
  logger: null // optional { debug, info, warn, error } logger
}

As a client, port, host and udp default to what the server advertises. Pass all three to skip that lookup.

If seed isn't set, the server makes a random one. Read it back from hs.info.seed and save it to keep the same invite across restarts.

await hs.ready()

Start the server or client. Resolves when it is listening.

await hs.close()

Shut it down and close all tunnels.

await hs.pause()

Suspend the underlying DHT, for example when the app goes to the background.

await hs.resume()

Resume after a pause.

hs.info

Object describing the current state.

{
  server: true, // true if running as a server
  client: false, // true if running as a client
  state: 'listening', // 'listening', 'paused' or 'destroyed'
  port: 8080,
  host: '127.0.0.1',
  udp: false,
  invite: 'hs_...',
  seed: '<hex>' // server only
}

hs.proxy

The underlying holesail-server or holesail-client instance.

hs.on('listening')

Emitted when the server or client is listening.

hs.on('connection')

Emitted on the server when a peer connects.

hs.on('connect')

Emitted on the client when it opens a new tunnel to the server, once per local connection.

const { port, host, udp } = await Holesail.probe(invite, [dht])

Ask a server what it is exposing without opening a tunnel. Pass your own hyperdht instance to reuse it, otherwise a temporary one is made.

const seed = Holesail.randomSeed()

Make a new random 64 char hex seed.

License

AGPL-3.0