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

routier

v0.1.2

Published

Analizador de rutas para Next.js y GraphQL que exporta a Postman e Insomnia

Readme

Routier

Routier es una CLI que analiza proyectos Next.js (App Router y Pages Router), detecta endpoints REST y operaciones GraphQL, y genera colecciones importables en Postman e Insomnia.

npm version license

Instalación

npm install -g routier

o con pnpm:

pnpm add -g routier

Uso Rápido

Escanear un proyecto

routier scan --cwd /ruta/a/proyecto-next

Detecta y lista:

  • ✅ Endpoints REST/HTTP (GET, POST, PUT, PATCH, DELETE)
  • ✅ Operaciones GraphQL (Queries, Mutations)
  • ⚠️ Warnings si hay problemas de parseo

Exportar a Postman e Insomnia

routier export --cwd /ruta/a/proyecto-next --format all --group-by type --sort alpha

Genera dentro del proyecto:

routier-exports/
  ├── routier-postman.json    # Colección Postman v2.1
  └── routier-insomnia.json   # Workspace Insomnia export format 4

Luego importa los archivos en:

  • Postman: File → Import → Select file
  • Insomnia: File → Import from file

Ejemplos

Scan básico

routier scan --cwd ./myapp

Export con agrupación y orden

routier export \
  --cwd ./myapp \
  --format all \
  --group-by type \
  --sort alpha \
  --base-url http://localhost:3000

Export solo Postman, salida plana

routier export \
  --cwd ./myapp \
  --format postman \
  --group-by none

Con schema GraphQL externo

routier export \
  --cwd ./myapp \
  --graphql-schema ./schemas/api.graphql \
  --format all

Opciones

| Opción | Descripción | Defecto | |--------|-------------|---------| | --cwd <path> | Ruta del proyecto a analizar | . | | --format <fmt> | Formato: all, postman, insomnia | all | | --out <path> | Carpeta de salida | ./routier-exports | | --base-url <url> | URL base para requests | {{baseUrl}} | | --group-by <mode> | Agrupar por: type, method, path, none | type | | --sort <order> | Orden: alpha, none | alpha | | --graphql-schema <path> | Schema GraphQL externo (.graphql o .gql) | Auto-detecta | | --framework <fw> | Framework: next | next |

Características

🎯 Detección automática

  • Next.js App Router: Rutas en app/**/route.ts
  • Next.js Pages Router: Rutas en pages/api/**/*.ts
  • GraphQL: Schemas .graphql, .gql y gql/typeDefs estáticos en TypeScript

📁 Normalización de rutas

  • Rutas dinámicas Next.js ([id], [...slug]) → formato de parámetro (:id, :slug)
  • Route groups ((admin)) → invisibles en la ruta final

🎨 Agrupación visual

  • Por tipo: REST y GraphQL como carpetas principales
  • Por método: GET, POST, PUT, etc.
  • Por ruta: Agrupación jerárquica de paths
  • Plana: Sin agrupación, lista lineal

📊 Exportadores nativos

  • Postman Collection v2.1: Importable directamente
  • Insomnia export format 4: Con workspace y environment predefinido

Roadmap

  • ✅ MVP: Next.js + GraphQL + Postman/Insomnia
  • 🔮 Próximas versiones:
    • Soporte para Express, Fastify, NestJS
    • Inferencia de auth headers
    • Configuración persistente (routier.json)
    • CI/CD integration

Licencia

ISC

Contribuyendo

Las contribuciones son bienvenidas. Por favor:

  1. Fork el repositorio
  2. Crea una rama (git checkout -b feature/amazing-feature)
  3. Commit tus cambios (git commit -m 'Add amazing feature')
  4. Push a la rama (git push origin feature/amazing-feature)
  5. Abre un Pull Request

Soporte

Para reportar bugs o solicitar features, abre un issue en GitHub.


Made with ❤️ by FHX23