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

@smalie/haxball-local

v1.0.1

Published

A custom fork of haxball.js with local file reading support

Readme

NPM Version NPM Monthly Downloads

License Last Commit Language Most Used Implementations Repository Size

Forks Stars Watches

🔖 Table Of Contents


💻 Installing

npm install haxball.js

Module Usage Example

const HaxballJS = require('haxball.js');

HaxballJS().then((HBInit) => {
  // Same as in Haxball Headless Host Documentation
  const room = HBInit({
    roomName: 'Haxball.JS',
    maxPlayers: 16,
    public: true,
    noPlayer: true,
    token: 'YOUR_TOKEN_HERE', // Required
  });

  room.setDefaultStadium('Big');
  room.setScoreLimit(5);
  room.setTimeLimit(0);

  room.onRoomLink = function (link) {
    console.log(link);
  };
});

(Optional) Custom WebRTC Library

Haxball.JS uses node-datachannel as the default WebRTC library. However, you can use a custom WebRTC implementation by specifying it in the HaxballJS promise using the webrtc option.

Example:

const HaxballJS = require('haxball.js');
const WebRTC = require('webrtc');

HaxballJS({ webrtc: WebRTC }).then((HBInit) => {...});

(Optional) Proxy

Haxball has a limit of 2 rooms per IP. Therefore, you can use proxy with adding proxy: "http://<YOUR_PROXY_IP>" in your RoomConfig.

Example:

HBInit({
    ...
    proxy: "http://1.1.1.1:80",
});

💻 TypeScript

TypeScript Example

import HaxballJS from 'haxball.js';

HaxballJS().then((HBInit) => {...});

💻 (Optional, Highly Experimental!) Bun

It's highly experimental and risky to use it in a production environment, but haxball.js is compatible with Bun.JS.

bun install haxball.js
bun pm trust node-datachannel
bun index.ts

  • node-datachannel - WebRTC implementation for Node.JS
  • ws - Websocket Connection
  • json5 - JSON Helper Module
  • @peculiar/webcrypto - WebCrypto implementation for Node.JS
  • pako - ZLIB port for NodeJS
  • xhr2 - W3C XMLHttpRequest implementation for Node.JS
  • https-proxy-agent - Websocket Proxy Support
  • @types/haxball-headless-browser - Type definitions

Back To The Top


  • NPM
  • NodeJS Version >=18

Back To The Top


  • [x] Promise based
  • [x] Synchronous
  • [x] Performant
  • [x] Strongly Typed

Back To The Top


  • Make a fork of this repository
  • Clone to you machine and entry on respective paste
  • Create a branch with your resource: git checkout -b my-feature
  • Commit your changes: git commit -m 'feat: My new feature'
  • Push your branch: git push origin my-feature
  • A green button will appear at the beginning of this repository
  • Click to open and fill in the pull request information

Back To The Top


Back To The Top


Copyright © 2023 mertushka & basro

This project is licensed by MIT License.

Back To The Top