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

postflame

v1.0.3

Published

πŸ”₯ Generate Postman collections automatically from Hono + Zod routes.

Downloads

5,045

Readme

πŸ”₯ Postflame

Postflame is a powerful CLI tool that automatically generates Postman collections from your Hono applications with Zod schema validation. Transform your API routes into ready-to-use Postman collections in seconds!

✨ Features

  • πŸš€ Automatic Generation - Converts Hono routes to Postman collections instantly
  • πŸ“ OpenAPI Support - Reads from @hono/zod-openapi endpoints for rich documentation
  • πŸ”„ Fallback Parsing - Works even without OpenAPI by parsing routes directly
  • ☁️ Direct Upload - Push collections to Postman workspace via API
  • 🎯 Zod Integration - Leverages Zod schemas for request/response examples
  • πŸ“¦ Multiple Content Types - Supports JSON, form-data, and URL-encoded bodies
  • 🏷️ Smart Organization - Groups endpoints by tags into folders

πŸ“¦ Installation

npm install -g postflame

Or use with npx:

npx postflame <path-to-app.ts>

πŸš€ Quick Start

Super Simple Usage

Just run postflame in your project directory - it will auto-detect your app file!

# Auto-detect and generate
postflame generate

That's it! Postflame will:

  1. πŸ” Find your app file (app.ts, index.ts, or main.ts)
  2. πŸ“¦ Compile TypeScript automatically
  3. πŸ”₯ Generate postman.json
  4. ☁️ Auto-upload to Postman if POSTMAN_API_KEY is in your .env

With Auto-Upload to Postman

Create a .env file in your project root:

POSTMAN_API_KEY=your_api_key_here

Then run:

postflame generate

Or force push with the --push flag:

postflame generate --push

Custom Options

# Specify input file
postflame generate --input src/app.ts

# Custom output path
postflame generate --output my-api.json

# Short form
postflame gen -i src/app.ts -o api.json -p

πŸ“– Usage Examples

Example Hono App

import { Hono } from 'hono';
import { zValidator } from '@hono/zod-validator';
import { z } from 'zod';

const app = new Hono();

const ProductSchema = z.object({
  name: z.string(),
  price: z.number(),
  description: z.string().optional(),
});

app.get('/products', (c) => {
  return c.json({ products: [] });
});

app.post('/products', zValidator('json', ProductSchema), (c) => {
  const data = c.req.valid('json');
  return c.json({ success: true, product: data });
});

export { app };

Generate Collection

# Just run postflame - it handles everything!
postflame generate

With OpenAPI (Recommended)

For richer documentation with examples and descriptions:

import { OpenAPIHono } from '@hono/zod-openapi';
import { z } from 'zod';

const app = new OpenAPIHono();

app.openapi(
  {
    method: 'post',
    path: '/products',
    tags: ['Products'],
    request: {
      body: {
        content: {
          'application/json': {
            schema: z.object({
              name: z.string().openapi({ example: 'iPhone 15' }),
              price: z.number().openapi({ example: 999 }),
            }),
          },
        },
      },
    },
    responses: {
      200: {
        description: 'Product created successfully',
      },
    },
  },
  (c) => {
    return c.json({ success: true });
  }
);

// Important: Add the doc endpoint
app.doc('/doc', {
  openapi: '3.0.0',
  info: { title: 'My API', version: '1.0.0' },
});

export { app };

πŸ”§ CLI Commands & Options

Commands

postflame generate    # Generate collection (default)
postflame gen         # Short alias
postflame g           # Even shorter!
postflame run         # Alternative alias
postflame help        # Show help

Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --input <file> | -i | Path to app file | Auto-detected | | --output <file> | -o | Output file path | postman.json | | --push | -p | Force upload to Postman | Auto if API key in .env |

Auto-Detection

Postflame searches for these files in order:

  1. app.ts in root directory
  2. index.ts in root directory
  3. main.ts in root directory
  4. server.ts in root directory
  5. src/app.ts
  6. src/index.ts
  7. src/main.ts
  8. src/server.ts

Also checks for .js versions of these files.

πŸ”‘ Postman API Key Setup

Recommended: Use .env file

Create a .env file in your project root:

POSTMAN_API_KEY=your_api_key_here

Postflame will automatically read this and upload your collection!

Alternative: Environment Variable

# Linux/Mac
export POSTMAN_API_KEY=your_key_here

# Windows (PowerShell)
$env:POSTMAN_API_KEY="your_key_here"

Get Your API Key

  1. Go to Postman API Keys
  2. Click "Generate API Key"
  3. Copy and add to your .env file

πŸ› οΈ Programmatic Usage

You can also use Postflame as a library:

import { generatePostmanCollection, saveCollectionToFile } from 'postflame';
import { app } from './app';

const collection = await generatePostmanCollection(app, 'My API');
saveCollectionToFile(collection, 'output.json');

πŸ“‹ Requirements

  • Node.js 16+
  • A Hono application
  • TypeScript (recommended)

🀝 Contributing

Contributions are welcome! Feel free to open issues or submit PRs.

πŸ“„ License

MIT

πŸ”— Links


Made with πŸ”₯ by Tamiopia