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 🙏

© 2025 – Pkg Stats / Ryan Hefner

holesail-client

v2.3.0

Published

A client for connecting to Holesail P2P reverse proxy.

Readme

Holesail Client

Join our Discord Support Server

The Holesail Client is a Node.js and Bare module for connecting to Holesail Servers with secure and efficient data relaying.


Installation

Install the Holesail Client module via npm:

npm install holesail-client

Usage

Importing the Module

To use the module, require it in your project:

const HolesailClient = require('holesail-client')

Creating an Instance

Create a new instance of the HolesailClient class by passing your peer key:

const client = new HolesailClient({ key: '<key>' })

Secure Mode

To avoid leaking access capability on the DHT, pass the optional "secure" flag. Ensure the server is also configured for secure mode:

const client = new HolesailClient({ key: '<key>', secure: true })

Connecting to the Server

Use the connect method to establish a connection to the Holesail Server, opts are auto detected but you can specify custom opts:

client.connect({ port: 5000, host: '127.0.0.1', udp: true }, () => {
  console.log('Connected to the server')
})

Destroying the Connection

To terminate the connection and clean up resources, call the destroy method:

client.destroy()

Resuming and Pausing

You can also resume or pause the connection:

await client.resume()
await client.pause()

Example

Here is a complete example demonstrating how to use the Holesail Client:

const HolesailClient = require('holesail-client')

// Replace with your peer key
const client = new HolesailClient({ key: 'fwkkgncpatjpt5j6n53beqjoz7wtxtbse8d7u9z1y17esbz5dhpo' })

client.connect({ port: 8000, host: '127.0.0.1', udp: true }, () => {
  console.log('Connected to the server')
})

setTimeout(() => {
  console.log('Closing connection...')
  client.destroy()
}, 5000)

API Reference

new HolesailClient(opts)

Creates a new instance of the HolesailClient class.

Parameters:

  • opts (object): Options object:
    • key (string): A hexadecimal string representing your peer key.
    • secure (boolean, optional): Pass true to enable private connections. The server must also be running in secure mode. See private vs public mode

connect(options, callback)

Establishes a connection to a Holesail Server.

Parameters:

  • options (object): Connection options:
    • port (number): Port number of the server.
    • address (string): IP address of the server (default: "127.0.0.1").
    • udp (boolean, optional): Set to true for UDP connections.
  • callback (function): A function called once the connection is successfully established.

destroy()

Terminates the connection and releases associated resources.

resume()

Resumes the connection if it was paused.

pause()

Pauses the connection.

get(opts)

Retrieves a mutable record stored on the DHT.


client.info

Provides information about the current state of the client, including:

  • state: Current state of the client (e.g., 'listening', 'paused', 'destroyed').
  • secure: Indicates whether the connection is private.
  • port: Current port used for the connection.
  • host: Current host used for the connection.
  • protocol: Current protocol being used ('udp' or 'tcp').
  • key: Connection key from the server.
  • publicKey: The public key announced on DHT for discovery.

License

Holesail Client is released under the GPL-v3 License.

For more details, see the LICENSE file.


Community and Support

Join our Discord Support Server for help, discussions, and updates.