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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hypernode

v0.0.20

Published

A modular peer-to-peer networking library that enables you to easily create distributed systems.

Downloads

23

Readme

Build Status Downloads MIT license

HyperNode logo

THIS IS AN UNFINISHED PROJECT

HyperNode is an open-source Node.js framework for building both large to small scale peer-to-peer (P2P) networks. The aim is to create a framework which allows developers to easily create peer-to-peer applications using any transport they please. All the complicated stuff like NAT traversal, managing peer health, etc. are being taken care of by Hypernode. Currently only transport via UDP is supported but we aim to support TCP and WebRTC in the near future.

Todo's

  • Implement more transports (TCP, WebRTC, WebSockets).
  • Implement more mechanisms for NAT traversal (currently only UDP holepunching is supported).
  • Implement E2EE mechanisms.
  • Efficiently distribute data across the network using a DHT.

Installation

npm install --save hypernode

Getting started

A Hypernode network requires at least one bootnode to function properly.

const Hypernode = require('hypernode')

// Create a bootnode.
const keypair = {
  public: '-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----',
  private: '-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----'
}
const bootnode = new Hypernode({ port: 3000, keypair: keypair })

// Create a default node (Hypernode distinguishes between bootnodes and default nodes using the initialPeers prop)
const node = new Hypernode({ port: 3000, initialPeers: initialPeers, keypair: keypair })

By omitting the keypair property Hypernode will generate a new keypair for you. By omitting te initialPeers property Hypernode will assume you're setting up a bootnode, and thus will not start gossiping.

Events

Each node is also an event listener which means you can do stuff like:

const node = new Hypernode({ port: 3001 })

node.on('message', (data, peer) => {
  // Emitted whenever a message from the network is received. `peer` contains info about the message sender.
});

node.on('peer:connected', peer => {
  // Emitted whenever a new peer joins the network.
})

node.on('peer:disconnected', peer => {
  // Emitted whenever a peer disconnects from the network.
})

Documentation

In development

Contributing

In development

License

Code released under the MIT license.