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

@abdiev003/reqscope

v0.0.3

Published

Local API request tracing SDK for Node.js and Express.

Readme

ReqScope

ReqScope is a local API request tracing tool for Node.js and Express.

Open in StackBlitz

It helps you inspect:

  • request duration
  • slow internal steps
  • failed flows
  • request/response body preview
  • request/response headers
  • sensitive field masking
  • raw trace JSON
  • cURL reproduction
  • endpoint summaries

Why ReqScope?

When an API request is slow or fails, logs are often not enough.

ReqScope shows what happened inside the request:

POST /login 182ms

findUserByEmail      140ms
createAccessToken     40ms

So you can quickly answer:

  • Which step was slow?
  • Which step failed?
  • What request body came in?
  • What response went out?
  • Can I reproduce this request as cURL?

Installation

npm install @abdiev003/reqscope

Express usage

import express from "express";
import {
  reqscope,
  reqscopeErrorHandler,
  traceStep,
} from "@abdiev003/reqscope";

const app = express();

app.use(express.json());

app.use(
  reqscope({
    enabled: process.env.NODE_ENV !== "production",
    slowRequestThreshold: 300,
    slowStepThreshold: 100,
    endpointPrefix: "/__reqscope",
    maxPreviewSize: 5000,
    maxTraces: 100,
    sensitiveFields: ["password", "token", "secret"],
  }),
);

app.post("/login", async (req, res, next) => {
  try {
    const user = await traceStep("findUserByEmail", async () => {
      return db.user.findUnique({
        where: { email: req.body.email },
      });
    });

    const token = await traceStep("createAccessToken", async () => {
      return createToken(user);
    });

    res.json({ user, token });
  } catch (error) {
    next(error);
  }
});

app.use(reqscopeErrorHandler());

app.listen(3000);

Dashboard

ReqScope exposes trace data from your app:

GET /__reqscope/traces
GET /__reqscope/clear

Run the dashboard:

npm run dev:dashboard

By default, the dashboard connects to:

http://localhost:3000

You can change it with:

VITE_REQSCOPE_API_URL=http://localhost:4000

Options

| Option | Type | Default | Description | |---|---:|---:|---| | slowRequestThreshold | number | 300 | Marks a request as slow when total duration exceeds this value in ms. | | slowStepThreshold | number | 100 | Marks a traced step as slow when duration exceeds this value in ms. | | endpointPrefix | string | /__reqscope | Prefix for internal ReqScope endpoints. | | sensitiveFields | string[] | common secrets | Fields to redact from previews. | | maxPreviewSize | number | 5000 | Maximum serialized preview size. | | maxTraces | number | 100 | Maximum number of traces stored in memory. |

Sensitive data masking

ReqScope redacts sensitive keys by default:

password
token
secret
authorization
cookie
set-cookie
api_key
access_token
refresh_token

Example:

{
  "email": "[email protected]",
  "password": "[REDACTED]"
}

You can add custom fields:

reqscope({
  sensitiveFields: ["email", "phone"]
});

Development

Install dependencies:

npm install

Run the example API:

npm run dev:example

Run the dashboard:

npm run dev:dashboard

Build the SDK:

npm run build -w packages/sdk

Test requests

curl http://localhost:3000/
curl http://localhost:3000/slow
curl http://localhost:3000/error
curl -X POST http://localhost:3000/login \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer super-secret-token" \
  -d '{"email":"[email protected]","password":"secret123"}'

Current status

ReqScope is currently an MVP focused on local development.

Supported:

  • Express
  • manual step tracing with traceStep
  • local in-memory traces
  • local dashboard

Not yet supported:

  • production storage
  • authentication
  • team sharing
  • NestJS/Fastify/Django integrations
  • automatic ORM tracing