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

mbkutils

v1.2.0

Published

MBKTech's shared utilities, response formatters, handlebars helpers, and UI components for Node.js applications.

Readme

mbkutils

Shared utilities, standardized HTTP response envelopes, error & 404 handlers, URL validation, Handlebars view helpers, Universal Service Messenger with Block Kit engine, and reusable UI components across the MBK Tech ecosystem.

Features

  • Universal Service Messenger & Block Kit: Direct delivery of rich, interactive cards, system alerts, deployment notices, and security alerts to Beyvion Messenger (mbkchat) service channels (svc_*). Read Full Guide ➔
  • HTTP Response Envelopes: Consistent API response structures with sendSuccess and sendError.
  • Content Negotiation: isJsonRequest for determining API vs. HTML browser requests.
  • Error Handlers & 404 Pages: Redacted trace diagnostic views and graceful error handling.
  • Handlebars Helpers: 40+ view helpers for comparisons, date/time formatting, number humanization, byte sizing, and slug generation.
  • URL & Redirect Safety: Server-side SSRF prevention (isSafeFetchUrl) and open redirect mitigation (isSafeRelativeRedirect).
  • Shared UI Views: Ambient background elements, message overlays, version badges, and universal error layouts.

Installation

npm install mbkutils

Quick Start

1. ServiceMessenger & Block Kit (Beyvion Messenger Channels)

Dispatch rich cards, alerts, and operational telemetry directly to mbkchat service channels:

import { serviceMessenger, BlockKit } from "mbkutils";

// High-level formatted alert
await serviceMessenger.sendAlert({
  channel: "system_status",
  title: "Service Online",
  message: "Worker service instance online and healthy.",
  type: "success",
  fields: [
    { label: "Environment", value: "Production" },
    { label: "Latency", value: "14ms" }
  ]
});

// Composable Block Kit Card with action buttons
await serviceMessenger.sendCard({
  channel: "governance_alerts",
  title: "🏛️ Statutory Board Meeting",
  priority: "high",
  blocks: [
    BlockKit.header("🏛️ Statutory Board Meeting Convened"),
    BlockKit.section("Attendance is mandatory for all executive directors."),
    BlockKit.fields([
      { label: "Date", value: "Nov 15, 2026" },
      { label: "Quorum", value: "75% Confirmed" }
    ]),
    BlockKit.actions([
      { text: "View Agenda", url: "https://portal.mbktech.org", style: "primary" }
    ])
  ]
});

For comprehensive documentation, constructor options, audience targeting, idempotency keys, and multi-language HTTP contracts (Python, Go, Rust, cURL), see the Universal Service Messenger Guide.


2. Express Middleware & Response Handlers

import express from "express";
import { createErrorHandler, createNotFoundHandler, sendSuccess, isJsonRequest } from "mbkutils";

const app = express();

app.get("/api/ping", (req, res) => {
  return sendSuccess(res, { status: "pong" });
});

app.use(createNotFoundHandler({ defaultPage: "/home", defaultPageName: "Home" }));
app.use(createErrorHandler({ appName: "my-app" }));

3. Handlebars Helpers

import { commonHandlebarsHelpers } from "mbkutils";
import hbs from "express-handlebars";

const engine = hbs.create({
  helpers: commonHandlebarsHelpers,
  partialsDir: ["views/partials", "node_modules/mbkutils/views"]
});

License

MIT © Muhammad Bin Khalid, MBKTech.org