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

@dunx/infra

v3.1.3

Published

Database, Redis, queue, schedule, storage, image and logging infrastructure for dunx. drizzle over bun:sqlite and Bun.SQL, bullmq over Bun.RedisClient, plus Bun.file, Bun.Glob, Bun.S3Client, Bun.Image and @arkv/logger

Downloads

8,202

Readme

@dunx/infra

Infrastructure for dunx: databases, Redis/Valkey, queues, file storage, images, scheduling, pagination and logging. Eight areas, one package.

Where Bun ships the primitive, the primitive is what runs: Bun.SQL, bun:sqlite, Bun.RedisClient, Bun.file, Bun.Glob, Bun.S3Client, Bun.Image, Bun.cron. No pg, no better-sqlite3, no ioredis, no @aws-sdk, no glob, no sharp.

Three areas integrate a mature library rather than hand-rolling one, and each of those drives a Bun API underneath. drizzle-orm and bullmq are optional peer dependencies, so an app using only /files installs neither.

Install

bun add @dunx/infra @dunx/core
# plus what the areas you use need
bun add drizzle-orm   # /db
bun add bullmq        # /queue

The subpaths

The guide is canonical for every row; this table is the index.

| Subpath | What it is | Guide | | ------------------------ | ---------------------------------------------------------------- | ----------------------------------------------------------- | | @dunx/infra/db | drizzle over bun:sqlite and Bun.SQL, transactions, seeds | Database | | @dunx/infra/redis | Bun.RedisClient, named connections, pub/sub | Database | | @dunx/infra/queue | bullmq over Bun.RedisClient: handlers, publisher, worker | Queues | | @dunx/infra/schedule | Bun.cron and timers: @Cron, @Interval, @OnceOnBoot | Scheduling | | @dunx/infra/files | One Storage contract over Bun.file and Bun.S3Client | Files and images | | @dunx/infra/images | An immutable pipeline over Bun.Image | Files and images | | @dunx/infra/logger | @arkv/logger bound to core's Logger contract | Logging | | @dunx/infra/pagination | Keyset pagination: cursor codec, options parser, drizzle query | Database |

Usage

import { Module } from '@dunx/core';
import { DbModule, SqliteOptions } from '@dunx/infra/db';
import { RedisModule } from '@dunx/infra/redis';
import * as schema from './schema.js';

@Module({
  imports: [
    DbModule.forRoot(new SqliteOptions({ schema, filename: './app.db' })),
    // No url: Bun resolves $VALKEY_URL, then $REDIS_URL, then localhost.
    RedisModule.forRoot({ maxRetries: 0 }),
  ],
})
export class InfraModule {}

Every area also has a forRootAsync, which is forRoot with a factory in front of it. It exists for the one thing a zero-argument function cannot do: inject, so the url or the filename can come off ConfigService.

Two conventions

Anything injectable by a constructor parameter is a runtime class, never an interface, because an interface erases and leaves nothing for @dunx/transform to record.

It is an abstract class where dunx owns the contract (Storage, DbConnection, ImagesOptions) and the library's own class where it does not (BunSQLiteDatabase, ContextStore). The two token() exports, redisConnection(name) and LoggerSettings, name things no class can.

If an area is in the root barrel at all, all of it is. /db and /queue are the two the barrel does not re-export: each reaches an optional peer through a static import, so exporting them would make drizzle-orm and ioredis hard requirements of import '@dunx/infra'. Reach them at their subpaths.

Verified against

Bun 1.4.0, drizzle-orm 0.45.2 and bullmq 6.0.5. Bun's documentation is incomplete across every area here, so the behaviour was measured rather than read. The evidence is in docs/ARCHITECTURE.md and docs/bun-apis.md.

License

MIT