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

@brassproof/create

v1.0.1

Published

CLI tool to scaffold BRASS-protected applications

Readme

@brassproof/create

CLI tool to scaffold BRASS-protected applications with a single command.

Usage

Create a New Project

npx @brassproof/create create

Or install globally:

npm install -g @brassproof/create
brass create

Direct Project Creation

# Create Next.js app
npx @brassproof/create create next-app my-app

# Create Cloudflare Worker
npx @brassproof/create create worker my-worker

Project Types

Next.js App

Creates a Next.js 14 application with:

  • BRASS React hooks (useBrass)
  • Protected API routes (withBrassVerifier)
  • Example form component
  • TypeScript configuration
  • Tailwind CSS setup

Generated structure:

my-app/
├── app/
│   ├── page.tsx              # Example form using useBrass
│   └── api/
│       └── submit/
│           └── route.ts       # Protected API route
├── package.json
├── .env.example
└── README.md

Next steps:

cd my-app
npm install
cp .env.example .env.local    # Add your BRASS credentials
npm run dev

Cloudflare Worker

Creates a Cloudflare Worker with:

  • BRASS worker helper (createBrassWorker)
  • KV namespace configuration
  • Wrangler setup
  • TypeScript configuration

Generated structure:

my-worker/
├── src/
│   └── index.ts              # Worker with BRASS protection
├── wrangler.toml             # Cloudflare configuration
├── package.json
└── README.md

Next steps:

cd my-worker
npm install
wrangler kv:namespace create BRASS_KV  # Create KV namespace
# Update wrangler.toml with KV namespace ID
wrangler secret put BRASS_SECRET_KEY
wrangler secret put BRASS_ISSUER_PUBKEY
wrangler deploy

Interactive Mode

Running brass create without arguments starts interactive mode:

$ brass create

🛡️  BRASS Project Creator

? What type of project do you want to create? › 
  Next.js App (with React hooks)
  Cloudflare Worker

? Project name: › my-brass-app

Environment Variables

Next.js Projects

Create .env.local:

BRASS_SECRET_KEY=your_secret_key_here
BRASS_ISSUER_PUBKEY=issuer_public_key_hex

Cloudflare Workers

Set secrets via Wrangler:

wrangler secret put BRASS_SECRET_KEY
wrangler secret put BRASS_ISSUER_PUBKEY

Get issuer public key:

curl https://brass-issuer.tomjwxf.workers.dev/pub

Commands

create [type] [name]

Create a new BRASS-protected project.

Arguments:

  • type - Project type: next-app or worker
  • name - Project directory name

Options:

  • -h, --help - Display help
  • -V, --version - Display version

Examples:

# Interactive mode
brass create

# Create Next.js app
brass create next-app my-nextjs-app

# Create Cloudflare Worker
brass create worker my-worker

What Gets Created

Next.js App

Dependencies:

  • next - Next.js framework
  • react - React library
  • @brassproof/nextjs - BRASS Next.js integration
  • @brassproof/verifier - Core verifier
  • tailwindcss - Styling

Features:

  • Protected API route example
  • Client-side form with BRASS hook
  • TypeScript support
  • Tailwind CSS configuration
  • Environment variable setup

Cloudflare Worker

Dependencies:

  • @brassproof/cloudflare - BRASS Cloudflare integration
  • @brassproof/verifier - Core verifier
  • wrangler - Cloudflare CLI

Features:

  • Protected worker handler
  • KV namespace configuration
  • Rate limiting setup
  • TypeScript support
  • Wrangler configuration

Customization

After creating a project, you can customize:

Rate Limits

Edit the rateLimits configuration:

// Next.js: app/api/submit/route.ts
export const POST = withBrassVerifier(handler, {
  scope: 'custom-scope',
  rateLimits: {
    'custom-scope': { maxRequests: 100, windowSeconds: 3600 }
  }
})

// Worker: src/index.ts
export default {
  fetch: createBrassWorker(handler, {
    rateLimits: {
      'message': { maxRequests: 50, windowSeconds: 3600 }
    }
  })
}

CORS Headers

// Worker
export default {
  fetch: createBrassWorker(handler, {
    corsHeaders: {
      'Access-Control-Allow-Origin': 'https://yourdomain.com',
    }
  })
}

Troubleshooting

"Directory already exists"

The CLI will prompt you to overwrite. Choose yes to replace the existing directory.

"npm install fails"

Ensure you have Node.js 18+ installed:

node --version

"wrangler command not found"

Install Wrangler globally:

npm install -g wrangler

Learn More

License

MIT - see LICENSE for details.