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

create-bunspace

v0.3.1

Published

Multi-template project scaffolder for Bun

Downloads

717

Readme

create-bunspace

Multi-template project scaffolder for Bun with git submodule templates

npm version License: MIT

CLI scaffolder to create new projects from templates. Supports multiple templates via git submodules with automatic synchronization.

Quick Start

# Create a new project (default: monorepo)
bun create bunspace my-project

# Create with specific template
bun create bunspace my-bot --template telegram-bot

# Create with all options
bun create bunspace my-app --template monorepo --yes --no-git

Available Templates

| Template | Description | |----------|-------------| | monorepo | Bun monorepo for npm packages with workspaces | | telegram-bot | Production-ready Telegram bot with Telegraf and TypeScript |

Usage

Basic Usage

# Interactive mode (prompts for template and config)
bun create bunspace my-project

# Skip prompts with defaults
bun create bunspace my-project --yes

# Specific template
bun create bunspace my-project --template telegram-bot

Options

| Option | Alias | Description | |--------|-------|-------------| | --template <name> | -t | Template to use (monorepo, telegram-bot) | | --scope <scope> | -s | npm scope (e.g., @my-org) | | --description <text> | -d | Project description | | --author <name> | -a | Author name | | --dir <path> | | Target directory | | --yes | -y | Skip prompts, use defaults | | --no-git | | Don't initialize git | | --no-install | | Don't run bun install | | --help | -h | Show help |

Examples

# Monorepo with defaults
bun create bunspace my-lib

# Telegram bot with prompts
bun create bunspace my-bot --template telegram-bot

# Skip all prompts
bun create bunspace my-app -t monorepo -y

# Custom scope and description
bun create bunspace my-app --scope @mycompany --description "My app"

Template Management

The scaffolder uses git submodules for templates, allowing easy updates:

# List templates and their git status
bun run templates:list

# Sync all templates to latest
bun run templates:sync

# Sync specific template
bun run templates:sync monorepo

Development

# Clone repository
git clone https://github.com/MKS2508/mks-scaffolder.git
cd mks-scaffolder

# Install dependencies
bun install

# Run CLI directly
bun run dev my-project --template monorepo

# Build
bun run build

# Type check
bun run typecheck

How It Works

  1. Template Resolution: Checks git submodules first (templates/), falls back to embedded templates (dist/templates/)
  2. Placeholder Replacement: Replaces {{PLACEHOLDER}} patterns in template files
  3. Project Generation: Copies files, replaces placeholders, and optionally runs bun install

Template System

Adding a New Template

  1. Add as git submodule:

    git submodule add <repo-url> templates/<name>
  2. Update scripts/embed-templates.js to include the new template

  3. Add template choice to src/prompts.ts:selectTemplate()

  4. Add placeholder generation to src/generator.ts:generatePlaceholders()

Placeholder Syntax

Templates use {{PLACEHOLDER}} syntax for variable substitution:

Monorepo Template:

  • {{NAME}} - Project name
  • {{SCOPE}} - npm scope (without @)
  • {{DESCRIPTION}} - Project description
  • {{AUTHOR}} - Author name
  • {{YEAR}} - Current year

Telegram Bot Template:

  • {{BOT_NAME}} - Bot name
  • {{BOT_SCOPE}} - npm scope (without @)
  • {{BOT_DESCRIPTION}} - Bot description
  • {{TG_BOT_TOKEN}} - Bot token
  • {{AUTHOR}} - Author name
  • {{YEAR}} - Current year

Architecture

mks-scaffolder/
├── bin.ts                    # Executable entry point
├── src/
│   ├── cli.ts                # Main CLI orchestration
│   ├── generator.ts          # Project generation
│   ├── template-manager.ts   # Git submodule management
│   ├── prompts.ts            # Interactive prompts
│   ├── types.ts              # TypeScript definitions
│   └── utils.ts              # Utilities
├── scripts/
│   └── embed-templates.js    # Copies templates to dist/
├── templates/
│   ├── monorepo/             # Submodule: mks-bun-monorepo
│   └── telegram-bot/         # Submodule: mks-telegram-bot
└── dist/
    └── bin.js                # Built CLI (for npm publishing)

Documentation

  • CLAUDE.md - Developer documentation and architecture guide

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © MKS2508