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

@bgunnarsson/create-galdur

v1.0.15

Published

Scaffold a Galdur framework project.

Readme

@bgunnarsson/create-galdur

Interactive project scaffolder for Galdur. Generates a new Galdur application with the correct directory structure, configuration files, and entry points.

Usage

pnpm create galdur
# or
npx @bgunnarsson/create-galdur

# With a project name and defaults (no prompts)
pnpm create galdur my-app --yes

# Skip the install step
pnpm create galdur my-app --yes --skip-install

No installation required — use directly via package manager's create command.

CLI flags

| Flag | Effect | |------|--------| | [project-name] | Positional argument. When given, replaces the "Project name" prompt. | | -y, --yes | Skip all prompts and use defaults (pnpm, path aliases, production hardening, no plugins). | | --skip-install | Don't run the package manager install after scaffolding. | | -h, --help | Print usage. |

The scaffolder aborts if the target directory exists and is non-empty.

Interactive prompts

| Prompt | Type | Options | Default | Description | |--------|------|---------|---------|-------------| | Project name | text | free text | current directory name or my-galdur-app | Directory name and package.json name | | Package manager | select | pnpm, npm, yarn, bun | pnpm | Used for the auto-install step | | Use path aliases? | confirm | yes / no | yes | Enables paths mapping in tsconfig.json | | Path alias prefix | text | free text (shown only when path aliases enabled) | @/ | Prefix for path aliases (e.g. @/* maps to ./src/*). Automatically normalized to include @ prefix and / suffix | | Production hardening? | confirm | yes / no | yes | Generates a production-grade server.ts with validateEnv, structured logger, Redis-backed rate limit store, and dependency probes. Adds @bgunnarsson/galdur-cache-redis + ioredis and emits src/shared/lib/redis.server.ts | | Optional plugins | multiselect | umbraco, cms, sentry, bugsnag, gtm, storybook | none | Adds the selected @bgunnarsson/galdur-plugin-* packages. Storybook lands in devDependencies; the rest in dependencies. Wiring is left to the user |

After file generation, the scaffolder runs install automatically and prints next steps:

cd <project-name>
pnpm run dev

What it generates

Running the scaffolder creates the following structure:

<project-name>/
├── public/                        # Static assets
├── src/
│   ├── app/
│   │   ├── api/                   # File-based API routes (Hono handlers)
│   │   ├── server.ts              # Server entry point
│   │   ├── entry.client.tsx       # Client hydration entry
│   │   └── +path.server.tsx       # Default catch-all SSR route
│   ├── features/                  # Feature modules
│   ├── middleware/
│   │   └── meta.ts                # Request/envelope meta middleware
│   ├── shared/
│   │   └── styles/
│   │       └── main.css           # Tailwind entry
│   └── views/
│       ├── layouts/
│       │   ├── base.tsx           # Default layout
│       │   └── rules.ts           # Path → layout match rules
│       ├── Frontpage.server.tsx
│       ├── Error404.server.tsx
│       ├── Error500.server.tsx
│       └── index.ts               # Template registry (used by pickTemplate)
├── .gitignore
├── .env.example                   # When production hardening is enabled
├── galdur.config.ts               # Framework configuration
├── package.json
├── tsconfig.json
└── index.html                     # HTML template

Generated file details

galdur.config.ts — Framework configuration with styles: 'tailwind', cache policy, server settings, layouts (rules + sourceDir/compiledDir), file-based API config, actions, banner, and a globalMiddlewares array wired with metaMiddleware.

src/app/server.ts — Server entry point. Imports config and starts either the dev or production server based on NODE_ENV. With production hardening enabled, the production branch runs validateEnv for REDIS_URL/PORT, dynamically imports redis.server.ts and @bgunnarsson/galdur-cache-redis/rate-limit after env validation, attaches a redis DependencyProbe, and wires a structured logger plus request/response observability hooks into the server options.

src/shared/lib/redis.server.ts (production hardening only)ioredis singleton with enableOfflineQueue: false, exponential-backoff retry capped at 30s, and throttled error logging.

src/app/entry.client.tsx — Client entry. Installs client-side navigation, route progress bar, and islands hydration.

src/app/+path.server.tsx — Catch-all SSR route. Resolves a page for the current pathname (stub resolvePage function — replace with your CMS or filesystem lookup), uses pickTemplate(views, page.type) to pick the matching React component, builds an envelope with ensureEnvelope, and falls back to Error404 / Error500 on miss / throw.

src/views/Frontpage.server.tsx — Default homepage template. Receives an Envelope-shaped data prop.

src/views/Error404.server.tsx, Error500.server.tsx — Error templates rendered by the catch-all route on miss / throw.

src/views/index.ts — Template registry exporting views (used by pickTemplate) and a TemplateKey type.

src/views/layouts/base.tsx — Default Layout that wraps the rendered element/HTML in a #__galdur_main container.

src/views/layouts/rules.tsLayoutRule[] selecting which layout(s) apply to which paths. Default rule matches everything to base.

src/middleware/meta.tsmetaMiddleware that builds a request object from ctx.c.req (with resolvePublicOrigin fallback for relative URLs) and writes request + meta (pathname, locale, method, url, host, query) onto both ctx.state and the response envelope.

src/shared/styles/main.css — Tailwind entry (@import "tailwindcss").

index.html — HTML shell with SSR outlet, preload, and stylesheet link for /main.min.css.

tsconfig.json — Strict TypeScript config targeting ES2022 with Bundler module resolution, JSX support, and incremental builds. When path aliases are enabled, includes the configured paths mapping.

Generated dependencies

Runtime dependencies

| Package | Description | |---------|-------------| | @bgunnarsson/galdur-actions | Server action discovery | | @bgunnarsson/galdur-document | SSR document shaping | | @bgunnarsson/galdur-islands | Islands registry and hydration | | @bgunnarsson/galdur-middleware | Render pipeline middleware | | @bgunnarsson/galdur-router | Routing and render context | | @bgunnarsson/galdur-server | Dev and production server runtime | | react | UI library | | react-dom | React DOM renderer |

Dev dependencies

| Package | Description | |---------|-------------| | @bgunnarsson/galdur-vite | Shared Vite config (SWC + React) | | @types/node | Node.js type definitions | | @types/react | React type definitions | | @types/react-dom | React DOM type definitions | | cross-env | Cross-platform environment variables | | hono | Lightweight web framework (API routes) | | tsx | TypeScript execution for dev server | | typescript | TypeScript compiler | | vite | Build tool |

Tailwind dependencies

Tailwind CSS is included by default. The following dev dependencies are always added:

| Package | Description | |---------|-------------| | @bgunnarsson/galdur-plugin-tailwind | Galdur Tailwind integration | | @tailwindcss/cli | Tailwind CSS CLI | | tailwindcss | Tailwind CSS framework |

A tw:dev script is also generated for Tailwind watch mode.

Conditional dependencies (production hardening)

When production hardening is enabled, these runtime dependencies are added:

| Package | Description | |---------|-------------| | @bgunnarsson/galdur-cache-redis | Redis-backed rate-limit store (and optionally fragment / fetch cache) | | ioredis | Redis client used by the singleton in src/shared/lib/redis.server.ts |

Conditional dependencies (plugins)

Selected from the Optional plugins multiselect. Each adds the matching @bgunnarsson/galdur-plugin-* package — runtime for everything except Storybook, which is a devDependency:

| Plugin | Package | Location | |--------|---------|----------| | Umbraco | @bgunnarsson/galdur-plugin-umbraco | dependencies | | Headless CMS | @bgunnarsson/galdur-plugin-cms | dependencies | | Sentry | @bgunnarsson/galdur-plugin-sentry | dependencies | | Bugsnag | @bgunnarsson/galdur-plugin-bugsnag | dependencies | | Google Tag Manager | @bgunnarsson/galdur-plugin-gtm | dependencies | | Storybook | @bgunnarsson/galdur-plugin-storybook | devDependencies |

Scaffolder dependencies

  • @clack/prompts — interactive terminal prompts
  • execa — runs the package manager install subprocess
  • picocolors — terminal colours for output