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

@http-forge/codegen

v0.1.9

Published

HTTP Forge Code Generator - Generate typed API clients from collections

Readme

@http-forge/codegen

npm version npm downloads VS Code Marketplace license node

Generate typed TypeScript API clients from HTTP Forge collections.

Turn your HTTP Forge workspace requests into fully-typed, Playwright-ready API client functions with schema-first types, path param constraints, and barrel exports.

Built for HTTP Forge workflows from import to execution: bring in Postman/OpenAPI definitions, then generate production-ready TypeScript clients for tests and apps.

Want the full interactive HTTP Forge experience? Use the VS Code extension: HTTP Forge.

Who It Is For

  • Teams who author requests in HTTP Forge and want typed Playwright tests.
  • TypeScript developers who want contract-safe API client code without manual boilerplate.
  • QA engineers who want to automate API tests generated directly from live request definitions.
  • CI/CD pipelines that auto-regenerate clients when the API changes.

Why @http-forge/codegen

  • Go from collection → typed Playwright client in one command.
  • Schema-first generation from body.schema.json and response.schema.json.
  • Path param constraints become union types or string with @pattern JSDoc.
  • Works alongside @http-forge/playwright runtime — generated clients depend on it.
  • Generate all, one collection, or one request.

Postman To Typed Client Workflow

Use HTTP Forge to convert existing Postman assets into typed client code quickly:

  • Import Postman collection export with HTTP Forge CLI.
  • Import Postman environment export.
  • Run and validate imported APIs in HTTP Forge.
  • Generate typed TypeScript clients with @http-forge/codegen.
# Import Postman collection and environment via CLI
http-forge import collection --postman ./MyApi.postman_collection.json
http-forge import env --postman ./MyEnv.postman_environment.json --env staging --overwrite

# Run imported collection
http-forge run collection "MyApi" --env staging --exit-code

# Generate typed clients from resulting workspace collections
npx http-forge-codegen --input ./collections --output ./api-clients

How It Fits In The HTTP Forge Family

| Component | Role | |---|---| | HTTP Forge VS Code extension | Build and validate requests/collections in workspace | | @http-forge/core | Shared execution and Postman-compatible runtime behavior | | @http-forge/codegen | Generates typed TypeScript API client functions from your workspace | | @http-forge/playwright | Runtime + shared types used by generated Playwright clients | | HTTP Forge CLI | Headless collection/suite runs and reporting for CI/CD |

@http-forge/codegen is the bridge between your HTTP Forge workspace and your Playwright test code. Generated clients import from @http-forge/playwright and work directly with the Playwright test runner.

1-Minute Quickstart

# 1) Install standalone codegen
npm install @http-forge/codegen

# 2) Generate all collections
npx http-forge-codegen --input ./collections --output ./api-clients

# Optional: one-command family workflow via CLI
# npm install --global @http-forge/cli
# http-forge generate --input ./collections --output ./api-clients

# 3) Use in Playwright tests
import { test, expect } from '@playwright/test';
import { ForgeEnv } from '@http-forge/playwright';
import { getUser } from './api-clients/user-api/get-user';

test('get user', async ({ request }) => {
    const env = ForgeEnv.create({ baseUrl: 'https://api.example.com' });
    const res = await getUser({ request, env, params: { userId: '123' } });
    expect(res.ok()).toBeTruthy();
});

Core Commands

| Command | Purpose | |---|---| | --input / -i | Path to HTTP Forge collections folder | | --output / -o | Output path for generated clients | | -c, --collection | Generate a single collection only | | -r, --request | Generate a single request only | | --overwrite | Overwrite existing generated files | | --types-only | Emit type definitions only, no runtime functions | | --no-barrel | Skip index.ts barrel file generation |

Installation

# Standalone package
npm install @http-forge/codegen

# Optional: use via CLI (single global entry point)
npm install --global @http-forge/cli

To manage requests visually, import from Postman/OpenAPI, and run suites with reporting, install the VS Code extension: HTTP Forge.

Use Through HTTP Forge CLI

If you prefer one global tool entry point, run code generation through CLI:

http-forge generate --input ./collections --output ./api-clients
http-forge generate --input ./collections --output ./api-clients --collection forgerock-login
http-forge generate --input ./collections --output ./api-clients --request forgerock-login/login-request

Detailed Docs

License

MIT