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

hackchat-server

v2.3.1

Published

A module-based websocket relay server

Downloads

64

Readme

NPM version NPM downloads travis build Dependency Status Codecov Language grade: JS/TS MIT License semantic-release Patreon

Table of contents

About

hackchat-server is a general use websocket server module designed to quickly bootstrap an application. The protocol is json only, with a module-based RPC-style command structure.

  • Hot reload support
    • Update code without losing current connections
  • Built in ratelimiting & ip ban
  • Simple statistics tracking
  • Self documenting *
  • Session recovery *
  • Multi-language support
  • Quick module boilerplate generation
    • npx hc-generate-cmd

Installation

Node.js (version 14.0) or newer is required.

Add to your project with npm install hackchat-server --save.

Once installed, run npx hc-config to generate a config file. Skip this step if you are using an existing config file.

Next, you may choose to run npx hc-import and import the standard modules. You should, at minimum, import the internal/* modules, unless you're working with existing command module files. The hc-import script will accept a --remote argument to import remote command modules, like npx hc-import --remote=https://github.com/someUser/command-modules.git. (Note: currently this feature is unavailable)

Or use npx hc-generate-cmd to quickly generate boilerplate modules.

All hc-config, hc-import & hc-generate-cmd scripts support multiple languages via the --lang argument. See example values in languages section. Example: hc-generate-cmd --lang=fr

Example usage

import { CoreApp } from 'hackchat-server';

const server = new CoreApp({
  configPath: '.hcserver.json',
  logErrDetailed: true,
  lang: 'en',
});

server.init();

Standard Modules

  1. internal\disconnect.js CLient disconnection event handler
  2. internal\socketreply.js Client error/warn event handler
  3. remote\session.js Standard remote session handler
  4. utility\help.js Self documentation module
  5. utility\reload.js Command hot reloader module

Links

Languages

Currently supported:

Contributing

Languages:

After forking & cloning this repo, navigate to the src/translations directory. Duplicate the en.json file. What you name the duplicate json file is fairly important, highly suggest that you use the two-letter ISO 639-1 abbreviations. The new language file will then be used by the lang property passed to the server, or by the --lang argument on the npx scripts.

Issues:

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the documentation.