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

nestjs-endpoints

v3.2.0

Published

Write each NestJS endpoint as one file: its folder gives it a URL, its routers give it path parameters, providers and guards, and its Zod schemas give it validation and a typed axios or React Query client.

Readme

nestjs-endpoints

CI

End-to-end type safety, built on NestJS controllers.

Write each endpoint as one file, with Zod schemas for its request and response and a handler. nestjs-endpoints serves it at a route that comes from where the file sits, hands it the path parameters, providers and guards the routers of its folders declare, validates what goes in and out, and generates a typed axios or React Query client from the same schemas.

Documentation: nestjs-endpoints.dev

Features

  • NestJS controllers underneath. Modules, providers, guards, interceptors and the Express, Fastify and node:http adapters work as they do in any Nest app.
  • File-based routing. An endpoint's URL is its path in the folder, or a path you give it.
  • Validation and types from one schema. Bodies, search parameters and path parameters are parsed before the handler runs, and a response that doesn't match its schema doesn't compile.
  • Generated clients. A typed axios client or React Query hooks, nested by the routers' namespaces.
  • Routers that share down the tree. A router.ts declares a folder's path parameters, providers, guards, middleware and interceptors once, for every endpoint under it and every router nested in it.
  • State and lifecycle hooks. An endpoint or a router keeps its own properties and methods, and runs NestJS's lifecycle hooks.
  • Built for coding agents. An agent rules file and a skill that point an agent at the docs shipped inside the package, and a /nestjs-endpoints-refactor skill that reworks an API to the recommended architecture.

Install

npm install nestjs-endpoints zod

Requires Node.js 24.22, NestJS 12, TypeScript 6 and Zod 4.1 or newer, in an ESM project.

Quick start

// src/app.module.ts
import { Module } from '@nestjs/common';
import { NestjsEndpoints } from 'nestjs-endpoints';

@Module({
  imports: [NestjsEndpoints.forRoot({ router: { rootDirectory: './endpoints' } })],
})
export class AppModule {}
// src/endpoints/greet.endpoint.ts  →  POST /greet
import { endpoint, z } from 'nestjs-endpoints';

export default endpoint.query({
  input: z.object({ name: z.string() }),
  output: z.string(),
  handler: ({ input }) => `Hello, ${input.name}!`,
});
// with the generated clients
const greeting = await client.greet({ body: { name: 'Satie' } });
const { data } = client.useGreet({ body: { name: 'Satie' } });

Documentation

A complete example, an API with a React front end, is in examples/file-based-routing.

For coding agents, the docs are indexed at nestjs-endpoints.dev/llms.txt, and ship inside the package at node_modules/nestjs-endpoints/docs/llms.txt.

License

MIT