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

@bitbeat/web

v0.0.21

Published

The web server module for bitbeat.

Downloads

35

Readme

BITBEAT WEB MODULE

Introduction

This is the official web module for bitbeat using fastify as web server. This package will export you a web server, a web server config and basic default actions. To use it follow the documentation of bitbeat at the homepage.

Default modules

The following modules are always enabled:

Optionally these modules can be enabled or disabled:

Configure

The default WebConfig looks like this:

export default class WebServerConfig extends Configuration {
    constructor() {
        super();
    }

    default: WebConfigProperties = {
        options: {
            disableRequestLogging: true,
        },
        host: '0.0.0.0',
        port: 8080,
        pathForActions: 'api',
        useVersioning: true,
        useHeaderVersioning: false,
        enableMiddlewares: true,
    };

    production: WebConfigProperties = {
        fastifyRateLimit: {
            max: 100,
        },
        underPressure: {
            maxEventLoopDelay: 1000,
            maxHeapUsedBytes: 100000000,
            maxRssBytes: 100000000,
        },
    };
}

You can edit those properties by either extending the WebConfig class in your project's config folder as own class or edit it in the boot.js.

Example 1:

-- config  |-- myOwnConfig.ts

import { WebConfig } from '@bitbeat/web';
import { merge } from 'lodash';

export default class MyOwnConfig extends WebConfig {
    constructor() {
        super();
    }

    default = {}; // this will overwrite the default props

    /* or you can do something non-destructive like this
    default = merge(default, {
        port: 3000,
    });
    */
}

Example 2:

This example happens in the boot.js:

import { registerBulk } from '@bitbeat/core';
import { WebConfig, WebServer } from '@bitbeat/web';

export default async () => {
    const webConfig = new WebConfig();
    webConfig.default.port = 3000;
    await registerBulk(new Set([webConfig, WebServer]));
};

Custom integrations

To add your own custom logic to the existing server use one of the following methods:

  • preRegister
  • postRegister
  • postRouteRegister
  • postServerStart
  • postServerStop

These are a sets of functions, which will run one by one and support async. There is always the "current" WebServer-runtime and WebConfig provided in those functions.

Add actions

To add your own web action to the web server, just extend the WebAction-class in the actions folder and the web server will automatically load them. Examples can be found in the default web actions.