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

dm-api-tool

v0.1.9

Published

Generate focused TypeScript API files from Swagger/OpenAPI specs.

Readme

dm-api-tool

Tiny npm CLI for generating focused TypeScript API files from Swagger/OpenAPI.

MVP scope

  • Generate one API and its related data types.
  • Generate all APIs and their related data types.
  • Keep commands short.

Usage

npm i -g dm-api-tool

Initialize config in a frontend project:

dm init https://example.com/swagger-ui/index.html

Or write the built-in default config to the current directory:

dm set

Generate one API:

dm g POST /user/login

If a path only has one method, the method can be omitted:

dm g /health

Generate all APIs:

dm all

Generated API functions receive a request method as the first argument, so they can use your project's own HTTP layer instead of fetch:

import { update2 } from "./dm-api/update2";

const result = await update2(request.post, {
  id: 1,
  roleName: "Admin"
});

const resultWithHeaders = await update2(request.post, body, {
  Authorization: "Bearer token"
});

The request method only needs to match this shape:

type ApiRequestMethod<TResult = unknown> = (
  url: string,
  data?: any,
  headers?: HeadersInit,
) => Promise<TResult>;

Config

dm init creates dm.config.json:

{
  "input": "https://example.com/swagger-ui/index.html",
  "output": "dm-api",
  "headers": {},
  "translateNames": true
}

input can be an OpenAPI JSON URL, a Swagger UI URL, or a local JSON file. Generated files are written to dm-api by default, relative to the directory where the command is executed. If dm.config.json is missing, the CLI uses its built-in default config.

translateNames defaults to true and translates Chinese API summaries/descriptions into English function and file names. Set it to false if your Swagger descriptions contain sensitive internal data and should not be sent to an online translation service.

Notes

This MVP focuses on JSON OpenAPI/Swagger specs. YAML support, custom request clients, auth helpers, and prettier formatting can be added after the core workflow is stable.