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

buncargo

v1.0.26

Published

A Bun-powered development environment CLI for managing Docker Compose services, dev servers, and environment variables

Readme

Buncargo

Type-safe development environment CLI for Docker Compose-based projects. Handles container lifecycle, port isolation for git worktrees, and dev server orchestration. It's easy!

Quick Start

1. Create dev.config.ts in your project root

import { defineDevConfig } from 'buncargo'

export default defineDevConfig({
  projectPrefix: 'myapp',

  services: {
    postgres: {
      port: 5432,
      healthCheck: 'pg_isready',
      urlTemplate: ({ port }) => `postgresql://postgres:postgres@localhost:${port}/mydb`
    },
    redis: {
      port: 6379,
      healthCheck: 'redis-cli'
    }
  },

  apps: {
    api: {
      port: 3000,
      devCommand: 'bun run dev',
      cwd: 'apps/backend'
    },
    web: {
      port: 5173,
      devCommand: 'bun run dev',
      cwd: 'apps/frontend'
    }
  },

  envVars: (ports, urls) => ({
    DATABASE_URL: urls.postgres,
    REDIS_URL: urls.redis,
    API_PORT: ports.api
  }),

  hooks: {
    afterContainersReady: async (ctx) => {
      await ctx.exec('bunx prisma migrate deploy', { cwd: 'packages/prisma' })
    }
  },

  prisma: {
    cwd: 'packages/prisma'
  }
})

2. Run it

bunx buncargo dev           # Start containers + dev servers
bunx buncargo dev --up-only # Start containers only
bunx buncargo dev --down    # Stop containers
bunx buncargo dev --reset   # Stop and remove volumes
bunx buncargo typecheck     # Run TypeScript typecheck across workspaces
bunx buncargo prisma studio # Run prisma with correct DATABASE_URL
bunx buncargo env           # Print ports/urls as JSON

Or add scripts to package.json:

{
  "scripts": {
    "dev": "bunx buncargo dev",
    "dev:docker:down": "bunx buncargo dev --down",
    "typecheck": "bunx buncargo typecheck",
    "prisma": "bunx buncargo prisma"
  }
}

Programmatic Access

Need ports/urls in your code (e.g., for tests)?

import { loadDevEnv } from 'buncargo'

const env = await loadDevEnv()
console.log(env.ports.postgres)  // 5432 (or offset port)
console.log(env.urls.api)        // http://localhost:3000
console.log(env.urls.postgres)   // postgresql://...

Features

Worktree Isolation

Each git worktree automatically gets unique ports (offset 10-99) so you can run multiple branches simultaneously without conflicts.

Health Checks

Built-in health checks for common services:

  • pg_isready - PostgreSQL
  • redis-cli - Redis
  • http - HTTP endpoint check
  • tcp - TCP port check

URL Templates

Define connection URLs as functions:

urlTemplate: ({ port, host, localIp }) => 
  `postgresql://user:pass@${host}:${port}/db`

Default templates exist for: postgres, redis, clickhouse, mysql, mongodb

Lifecycle Hooks

hooks: {
  afterContainersReady: async (ctx) => { /* Run migrations */ },
  beforeServers: async (ctx) => { /* Seed database */ },
  afterServers: async (ctx) => { /* Post-startup tasks */ },
  beforeStop: async (ctx) => { /* Cleanup */ }
}

Hook Context

Hooks receive a context object with:

interface HookContext {
  projectName: string
  ports: { postgres: number, api: number, ... }
  urls: { postgres: string, api: string, ... }
  root: string
  isCI: boolean
  portOffset: number
  localIp: string
  exec(cmd: string, opts?): Promise<ExecResult>
}

Watchdog Auto-Shutdown

Containers automatically stop after 10 minutes of inactivity when running via CLI.

CLI Reference

COMMANDS:
  dev                 Start the development environment
  typecheck           Run TypeScript typecheck across workspaces
  prisma <args>       Run Prisma CLI with correct DATABASE_URL
  env                 Print environment info as JSON
  help                Show help
  version             Show version

DEV OPTIONS:
  --up-only           Start containers only (no dev servers)
  --down              Stop containers
  --reset             Stop containers and remove volumes
  --migrate           Run migrations only
  --seed              Run seeders

Environment Variables

The envVars function receives:

envVars: (ports, urls, context) => ({
  // ports: { postgres: 5432, api: 3000, ... }
  // urls: { postgres: "postgresql://...", ... }
  // context: { localIp, portOffset, isCI, root }
})

These are injected into:

  • Docker Compose (via COMPOSE_PROJECT_NAME)
  • Dev server processes
  • Hook exec() calls

Docker Compose

Your docker-compose.yml should use environment variables for ports:

services:
  postgres:
    image: postgres:16
    ports:
      - "${POSTGRES_PORT:-5432}:5432"