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-demokit

v0.1.2

Published

Set up DemoKit in your project — interactive product demos with mock data

Downloads

39

Readme

create-demokit

Set up DemoKit in your project with a single command. Detects your framework, installs the right packages, scans for API endpoints, generates fixture data, and wires up the provider.

npx create-demokit

What it does

  1. Detects your framework from package.json (Next.js, Remix, React Router, TanStack Query, SWR, tRPC, or plain React)
  2. Installs packages@demokit-ai/core plus the correct adapter for your framework
  3. Scans your codebase for API endpoints using schema parsers and fetch-call detection
  4. Generates fixtures with realistic placeholder data for each detected endpoint
  5. Creates a provider wrapper component tailored to your framework
  6. Wires the provider into your root layout or entry file
  7. Adds middleware for ?demo=true URL handling (Next.js only)

After setup, visit any page with ?demo=true to activate demo mode.

Usage

# Interactive setup in current directory
npx create-demokit

# Set up a specific project
npx create-demokit ./my-app

# Non-interactive with defaults
npx create-demokit --yes

# Preview changes without writing files
npx create-demokit --dry-run

# Set up with DemoKit Cloud
npx create-demokit --cloud

Flags

| Flag | Description | |------|-------------| | --yes, -y | Skip all prompts, use defaults | | --cloud | Generate DemoKit Cloud config and .env.local entries | | --framework <f> | Override detection: next, remix, react-router, tanstack-query, swr, trpc, react | | --level <l> | Data generation level: l1 (schema-valid) or l2 (relationship-valid, default) | | --dry-run | Show what would happen without making changes | | --no-install | Skip package installation | | --no-wire | Skip provider wiring (only generate fixtures) | | --verbose | Show detailed output | | -h, --help | Show help | | -v, --version | Show version |

What gets created

For a Next.js project, create-demokit generates:

lib/demo-fixtures.ts      # Fixture data for each detected endpoint
app/demo-providers.tsx     # DemoKitNextProvider wrapper component
middleware.ts              # Handles ?demo=true URL parameter

And modifies:

app/layout.tsx             # Wraps children with DemoKitProviders

The exact files vary by framework:

| Framework | Fixtures | Provider | Extra | |-----------|----------|----------|-------| | Next.js | lib/demo-fixtures.ts | app/demo-providers.tsx | middleware.ts | | Remix | app/demo/fixtures.ts | app/demo/providers.tsx | | | React Router | app/demo/fixtures.ts | app/demo/providers.tsx | | | TanStack Query | src/demo/fixtures.ts | src/demo/providers.tsx | | | SWR | src/demo/fixtures.ts | src/demo/providers.tsx | | | tRPC | src/demo/fixtures.ts | src/demo/providers.tsx | | | React | src/demo/fixtures.ts | src/demo/providers.tsx | |

Endpoint detection

The CLI finds your API endpoints using two strategies:

Schema parsers — statically analyze API route files, tRPC routers, Drizzle/Prisma schemas, Zod schemas, and TypeScript types to extract endpoints and data models.

Fetch-call finder — scans your client code for patterns like fetch('/api/...'), useSWR('/api/...'), useQuery(...), and axios.get(...) to discover which endpoints your app actually calls.

Both strategies run and results are merged. Schema-sourced endpoints take precedence when duplicates are found.

Fixtures

The generated fixture file maps HTTP method + URL pattern to response data:

import type { FixtureMap } from '@demokit-ai/core'

const DEMO_USERS = [
  { id: '1', name: 'Alice Johnson', email: '[email protected]', role: 'admin' },
  { id: '2', name: 'Bob Smith', email: '[email protected]', role: 'member' },
]

export const fixtures: FixtureMap = {
  'GET /api/users': () => DEMO_USERS,
  'GET /api/users/:id': ({ params }) => DEMO_USERS.find(u => u.id === params.id),
  'POST /api/users': ({ body }) => ({ id: crypto.randomUUID(), ...body }),
}

// Empty-state scenario
export const emptyFixtures: FixtureMap = {
  'GET /api/users': () => [],
}

Two scenarios are generated by default: fixtures (happy path with sample data) and emptyFixtures (empty state). Edit the file to add more scenarios or customize the data.

File conflicts

The CLI never silently overwrites existing files:

  • Interactive mode — prompts you to overwrite or skip
  • --yes mode — skips existing files (safe default)
  • --dry-run — shows what would happen without writing anything

DemoKit Cloud

With --cloud, the CLI also generates:

  • lib/demokit-config.ts — remote source configuration
  • .env.local entries — NEXT_PUBLIC_DEMOKIT_API_URL and NEXT_PUBLIC_DEMOKIT_API_KEY

Set your API key after setup to connect to DemoKit Cloud for AI-powered narrative fixture generation.

Requirements

  • Node.js 20+
  • A project with a package.json

License

Apache-2.0