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

glim-node

v0.0.20

Published

TypeScript-first primitives for building Hono services on Bun, plus a CLI that scaffolds projects and runs Drizzle migrations.

Readme

Glim Node

TypeScript-first primitives for building Hono services on Bun, plus a CLI that scaffolds projects and runs Drizzle migrations.

It gives you a typed app or module instance with environment-backed clients for databases, cache, storage, notifications, and outbound HTTP.

CLI

Install the CLI first:

bun add -g glim-node

Or run it without installing:

bunx glim-node create

Create a project

gn create --name my-app

Templates:

  • single-app
  • modular

Generate migrations

gn migrate:gen
gn migrate:gen --module ms-task

Apply migrations

gn migrate:up
gn migrate:up --module ms-task

For modular projects, the CLI can prompt for a module when needed. For single-app projects, it auto-detects the layout from src/db/models.

Requirements

  • Bun >= 1.3.11
  • TypeScript projects using ESM

Installation

Install the package:

bun add glim-node

Install the integrations you actually use:

# Postgres
bun add pg drizzle-orm
bun add -d @types/pg drizzle-kit

# MySQL
bun add mysql2 drizzle-orm

# Redis
bun add ioredis

# AWS
bun add @aws-sdk/client-s3 @aws-sdk/client-sns

After installation, the binary is gn.

App Shapes

createApp()

Use this for a single service with no namespace in its environment variables.

import { createApp } from "glim-node";

export const app = await createApp({
  db: { type: "db.postgres" },
  cache: { type: "cache.redis" },
  notification: {
    type: "notification.sns",
    config: { topics: ["task-created"] },
  },
  statsApi: { type: "http.webservice" },
});

createModule(namespace, config)

Use this for modular projects where each module owns its own namespaced resources.

import { createModule } from "glim-node";

export const tasks = await createModule("ms-task", {
  db: { type: "db.postgres" },
  cache: { type: "cache.redis" },
  storageAssets: { type: "storage.s3" },
  notification: {
    type: "notification.sns",
    config: { topics: ["task-created"] },
  },
});

Supported Features

| Feature type | Client exposed | | ------------------ | ------------------------------- | | db.postgres | Drizzle PostgreSQL client | | db.mysql | MySQL client | | cache.redis | ioredis client | | storage.s3 | Minimal S3 helper | | notification.sns | SNS publisher with typed topics | | http.webservice | Small typed HTTP client wrapper |

Quick Start

1. Build an app

import { createApp } from "glim-node";
import { Hono } from "hono";

const router = new Hono().get("/health", (c) => c.json({ ok: true }));

export const app = await createApp({
  db: { type: "db.postgres" },
  cache: { type: "cache.redis" },
});

const hc = app.loadRouter(router);
export const client = hc("http://localhost:3000");

2. Start the server

import { start } from "glim-node/server";
import { app } from "./app";

await start(app);

start() accepts either a single app/module or an array.

Environment Variable Conventions

Environment keys are derived from:

  • the feature prefix, such as DB, CACHE, STORAGE, NOTIFICATION, or HTTP
  • the module namespace, when using createModule("ms-task", ...)
  • the config key alias, unless the alias is the default name for that feature

| Config | Expected env prefix | | ------------------------------------------------------------------------- | -------------------------- | | db: { type: "db.postgres" } in createApp() | DB_* | | db: { type: "db.postgres" } in createModule("ms-task", ...) | DB_MS_TASK_* | | storageAssets: { type: "storage.s3" } in createApp() | STORAGE_ASSETS_* | | storageAssets: { type: "storage.s3" } in createModule("ms-task", ...) | STORAGE_MS_TASK_ASSETS_* |

Minimal single-app example:

APP_NAME="task-api"
APP_ENV="local"

DB_HOST="db:5432"
DB_DATABASE="postgres"
DB_USERNAME="postgres"
DB_PASSWORD="mypassword"

CACHE_HOST="cache"
CACHE_PORT="6379"

Minimal modular example:

APP_NAME="task-api"
APP_ENV="local"

DB_MS_TASK_HOST="db:5432"
DB_MS_TASK_DATABASE="postgres"
DB_MS_TASK_USERNAME="postgres"
DB_MS_TASK_PASSWORD="mypassword"