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

@suss/framework-nextjs

v0.3.2

Published

Pattern pack for extracting suss behavioral summaries from Next.js route handlers and pages.

Readme

@suss/framework-nextjs

Framework pack for Next.js route handlers. Next.js puts the route in the tree rather than in a registration call, so this pack finds handlers by where their file sits and reads the route out of the path to it.

What this package is

@suss/framework-nextjs returns a PatternPack object describing:

  • Discovery by file convention: app/**/route.ts exporting GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS, and pages/api/** exporting a default handler
  • Routes from the path: app/api/orders/[id]/route.ts answers /api/orders/{id}, a directory in parentheses groups files without appearing in the URL, and a catch-all is named after its parameter
  • Terminals: NextResponse.json, Response.json, NextResponse.redirect, res.status(n).json(body) in a pages handler, and throw
  • Input mapping: the request first, the route context second

A route here pairs with a client calling the same URL, and with a provider in another framework serving it, since /api/orders/{id} and /api/orders/:id compare equal.

What it does not cover yet

  • Server actions. A "use server" function is reached through a compiler-generated ID rather than a URL, so there is no boundary to pair it on.
  • Pairing a pages handler. One default export answers every method and switches on req.method inside, so the pack reports the path and leaves the method blank. A summary with no method does not pair with a caller, so those routes show up in an inventory and stop there.
  • Page components. @suss/framework-react already reads those.
  • A route a library serves. NextAuth's route file is export { GET, POST } from "@/auth", where those names come out of destructuring the library's own return. No function in the project answers that route, so nothing is reported for it.

Where it sits in suss

Depends only on @suss/extractor (for the PatternPack type). Contains no analysis logic.

Coverage

coverage

License

Licensed under Apache 2.0. See LICENSE.


For how framework packs work, see docs/framework-packs.md.