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

hono-takibi

v0.9.74

Published

Hono Takibi is a CLI tool that generates Hono routes from OpenAPI specifications.

Downloads

1,045

Readme

img

Hono Takibi

img

npm install -D hono-takibi

Migrate Legacy APIs to Hono

Hono Takibi is an OpenAPI-to-Hono code generator, specifically developed to assist in migrating APIs from various programming languages to Hono. This tool automates the creation of type-safe Hono routes from your existing OpenAPI specifications, making it easier to transition from legacy systems (Ruby, Perl, PHP, etc.) to a modern Hono architecture.

What Problem Does It Solve?

Moving to @hono/zod-openapi requires:

  • Manual conversion of OpenAPI paths to Hono routes
  • Translation of OpenAPI schemas to Zod schemas
  • Implementation of type-safe request/response handling

If you have OpenAPI specifications, Hono Takibi automates the conversion process to @hono/zod-openapi, allowing you to focus on implementing your business logic rather than dealing with boilerplate code. While we aim for full compatibility in the generated code, we're continuously working to improve the conversion accuracy and support more OpenAPI features. We welcome feedback and contributions to make this tool even better for the community.

Hono Takibi automates this process by:

  • Converting OpenAPI schemas to Zod schemas
  • Generating type-safe route definitions
  • Creating proper variable names and exports

Usage

npx hono-takibi path/to/input.{yaml,json,tsp} -o path/to/output.ts

input:

openapi: 3.1.0
info:
  title: Hono Takibi API
  version: "1.0.0"
paths:
  /:
    get:
      summary: Welcome
      description: Returns a welcome message from Hono Takibi.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Hono Takibi🔥
                required:
                  - message

output:

import { createRoute, z } from '@hono/zod-openapi'

export const getRoute = createRoute({
  method: 'get',
  path: '/',
  summary: 'Welcome',
  description: 'Returns a welcome message from Hono Takibi.',
  responses: {
    200: {
      description: 'OK',
      content: {
        'application/json': {
          schema: z.object({ message: z.string().openapi({ example: 'Hono Takibi🔥' }) }),
        },
      },
    },
  },
})

Demo

CLI

Options

Options:
  --export-schemas-types      export schemas types
  --export-schemas            export schemas
  --export-parameters-types   export parameters types
  --export-parameters         export parameters
  --export-security-schemes   export securitySchemes
  --export-request-bodies     export requestBodies
  --export-responses          export responses
  --export-headers-types      export headers types
  --export-headers            export headers
  --export-examples           export examples
  --export-links              export links
  --export-callbacks          export callbacks
  --template                  generate app file and handler stubs
  --test                      generate empty *.test.ts files
  --base-path <path>          api prefix (default: /)
  -h, --help                  display help for command

Example

npx hono-takibi path/to/input.{yaml,json,tsp} -o path/to/output.ts --export-schemas --export-schemas-types --template --base-path '/api/v1'

Configuration File (hono-takibi.config.ts)

Config used by both the CLI and the Vite plugin.

Config Reference

All available options are shown below. In practice, use only the options you need.

// hono-takibi.config.ts
import { defineConfig } from 'hono-takibi/config'

export default defineConfig({
  input: 'openapi.yaml',
  'zod-openapi': {
    output: './src/index.ts',
    exportSchemas: true,
    exportSchemasTypes: true,
    exportParameters: true,
    exportParametersTypes: true,
    exportSecuritySchemes: true,
    exportRequestBodies: true,
    exportResponses: true,
    exportHeaders: true,
    exportHeadersTypes: true,
    exportExamples: true,
    exportLinks: true,
    exportCallbacks: true,
    routes: {
      output: './src/routes',
      split: true,
    },
    components: {
      schemas: {
        output: './src/schemas',
        exportTypes: true,
        split: true,
        import: '../schemas',
      },
      parameters: {
        output: './src/parameters',
        exportTypes: true,
        split: true,
        import: '../parameters',
      },
      securitySchemes: {
        output: './src/securitySchemes',
        split: true,
        import: '../securitySchemes',
      },
      requestBodies: {
        output: './src/requestBodies',
        split: true,
        import: '../requestBodies',
      },
      responses: {
        output: './src/responses',
        split: true,
        import: '../responses',
      },
      headers: {
        output: './src/headers',
        exportTypes: true,
        split: true,
        import: '../headers',
      },
      examples: {
        output: './src/examples',
        split: true,
        import: '../examples',
      },
      links: {
        output: './src/links',
        split: true,
        import: '../links',
      },
      callbacks: {
        output: './src/callbacks',
        split: true,
        import: '../callbacks',
      },
    },
  },
  type: {
    output: './src/types.ts',
  },
  rpc: {
    output: './src/rpc',
    import: '../client',
    split: true,
  },
})

Essentials

  • Put hono-takibi.config.ts at repo root.
  • Default‑export with defineConfig(...).
  • input: openapi.yaml (recommended), or *.json / *.tsp.

About split

  • split: trueoutput is a directory; many files + index.ts.
  • split omitted or falseoutput is a single *.ts file (one file only).

Single‑file

One file. Set top‑level output (don't define components/routes).

import { defineConfig } from 'hono-takibi/config'

export default defineConfig({
  input: 'openapi.yaml',
  'zod-openapi': {
    output: './src/index.ts',
    exportSchemas: true,
    exportSchemasTypes: true,
  },
})

RPC (optional)

Works with either pattern.

  • split: trueoutput is a directory; many files + index.ts.
  • split omitted or falseoutput is one *.ts file.
import { defineConfig } from 'hono-takibi/config'

export default defineConfig({
  input: 'openapi.yaml',
  'zod-openapi': { output: './src/index.ts', exportSchemas: true, exportSchemasTypes: true },
  rpc: { output: './src/rpc', import: '../client', split: true },
})

Vite Plugin (honoTakibiVite)

Auto‑regenerates on changes and reloads dev server.

// vite.config.ts
import { honoTakibiVite } from 'hono-takibi/vite-plugin'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [honoTakibiVite()],
})

What it does

  • Watches: the config, your input, and nearby **/*.{yaml,json,tsp}.
  • Generates outputs per your config (single‑file or split, plus rpc).
  • Cleans old generated files safely when paths or split change.

That’s it — set input, choose one of the two patterns, and (optionally) add rpc. ✅

Demo (Vite + HMR)

⚠️ WARNING: Potential Breaking Changes Without Notice

This package is in active development and may introduce breaking changes without prior notice. Specifically:

  • Schema generation logic might be updated
  • Output code structure could be modified
  • Example value handling might be altered

We strongly recommend:

  • Pinning to exact versions in production
  • Testing thoroughly when updating versions
  • Reviewing generated code after updates

We welcome feedback and contributions to improve the tool!

Current Limitations

OpenAPI Support

  • Not all OpenAPI features are supported
  • Complex schemas might not convert correctly
  • Limited support for certain response types
  • Some OpenAPI validations may not be perfectly converted to Zod validations

License

Distributed under the MIT License. See LICENSE for more information.