{"_id":"@abdiev003/reqscope","_rev":"3-16613b47e2e42975ec275f1a4c1c2997","name":"@abdiev003/reqscope","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@abdiev003/reqscope","version":"0.0.1","keywords":["api","debugger","tracing","express","developer-tools","observability"],"author":"","license":"MIT","_id":"@abdiev003/reqscope@0.0.1","maintainers":[{"name":"abdiev003","email":"aliabdiyev000@gmail.com"}],"dist":{"shasum":"058014025519d677a3691b38c6924e089c4ef338","tarball":"https://registry.npmjs.org/@abdiev003/reqscope/-/reqscope-0.0.1.tgz","fileCount":18,"integrity":"sha512-mPPHAdAqpqqrMWqTEcveBiBxtbhniNMn72UwyA5H3v/opQd8k4CFpWNRFIYCK1TRP8mFsTpF5IQSfHrmkbOKMg==","signatures":[{"sig":"MEYCIQDKiRWxBDbQuJawhfB+r1+Ro239N8iLABjaz3pu4xkaJgIhAMwtWy6OBXSMG2/0bwDxer/G2EwWYvReZUfzUosEaH5c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17998},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"2362fbfa24fc8d67dd0d5223ba8170cf7172be34","scripts":{"build":"tsc","clean":"rm -rf dist","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"abdiev003","email":"aliabdiyev000@gmail.com"},"_npmVersion":"11.11.0","description":"Local API request tracing SDK for Node.js and Express.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"express":"latest","typescript":"latest","@types/node":"latest","@types/express":"latest"},"peerDependencies":{"express":">=4"},"_npmOperationalInternal":{"tmp":"tmp/reqscope_0.0.1_1777207531273_0.2542864092112904","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@abdiev003/reqscope","version":"0.0.2","keywords":["api","debugger","tracing","express","developer-tools","observability"],"author":"","license":"MIT","_id":"@abdiev003/reqscope@0.0.2","maintainers":[{"name":"abdiev003","email":"aliabdiyev000@gmail.com"}],"dist":{"shasum":"56bbb944f85a864be86383bbb9efe35cc923c837","tarball":"https://registry.npmjs.org/@abdiev003/reqscope/-/reqscope-0.0.2.tgz","fileCount":20,"integrity":"sha512-eZlyWHCBI0lz6FgioCqWbjZ4J0QmfWwfOtgneCdzex6RWugXY6QomG0JK7mmRo4TUvjit3eoTUp7hQB7KHxxOQ==","signatures":[{"sig":"MEUCIQC7nl2ZIKs7JUUWDFTFKx8kDK8rG/i1oJoxIesibEZtowIgOJV51qjKXnZON5avcBpl4Vvf/fPxsPbk1EQaO9kzBqU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19600},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"b4e83ca94c29f50b505b8ffceadbee5d68aeb308","scripts":{"build":"tsc","clean":"rm -rf dist","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"abdiev003","email":"aliabdiyev000@gmail.com"},"_npmVersion":"11.11.0","description":"Local API request tracing SDK for Node.js and Express.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"express":"latest","typescript":"latest","@types/node":"latest","@types/express":"latest"},"peerDependencies":{"express":">=4"},"_npmOperationalInternal":{"tmp":"tmp/reqscope_0.0.2_1777238260812_0.8502641193199985","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@abdiev003/reqscope","version":"0.0.3","description":"Local API request tracing SDK for Node.js and Express.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","clean":"rm -rf dist","prepublishOnly":"npm run clean && npm run build"},"keywords":["api","debugger","tracing","express","developer-tools","observability"],"author":"","license":"MIT","peerDependencies":{"express":">=4"},"devDependencies":{"@types/express":"latest","@types/node":"latest","express":"latest","typescript":"latest"},"gitHead":"893a6d7721e7f6634f2d89d745be6d563c6b2ae6","_id":"@abdiev003/reqscope@0.0.3","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-VzlhNFyl9iSx0gOo6T+m2ibyGR5wl5guBdLmZw41G14bImL7zGMAI7QmzrWTa4H9V0MnGSLUxQ4A5K7VOfd3Kg==","shasum":"98f65745d49424ec34c595f1f74e3b4d2c64368b","tarball":"https://registry.npmjs.org/@abdiev003/reqscope/-/reqscope-0.0.3.tgz","fileCount":20,"unpackedSize":19920,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBycyGBgIq3Wv5kQmNfQxyEa7YpBdwgl6ync6EnSidDdAiEAy+hmQUsFzKhlfihARf+Nr9yoNo5/57CsyuWLttXt2Co="}]},"_npmUser":{"name":"abdiev003","email":"aliabdiyev000@gmail.com"},"directories":{},"maintainers":[{"name":"abdiev003","email":"aliabdiyev000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/reqscope_0.0.3_1777411715770_0.9864936893362823"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-26T12:45:31.168Z","modified":"2026-04-28T21:28:36.246Z","0.0.1":"2026-04-26T12:45:31.414Z","0.0.2":"2026-04-26T21:17:40.993Z","0.0.3":"2026-04-28T21:28:36.129Z"},"license":"MIT","keywords":["api","debugger","tracing","express","developer-tools","observability"],"description":"Local API request tracing SDK for Node.js and Express.","maintainers":[{"name":"abdiev003","email":"aliabdiyev000@gmail.com"}],"readme":"# ReqScope\n\nReqScope is a local API request tracing tool for Node.js and Express.\n\n[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/Abdiev003/reqscope/tree/main/demo)\n\nIt helps you inspect:\n\n- request duration\n- slow internal steps\n- failed flows\n- request/response body preview\n- request/response headers\n- sensitive field masking\n- raw trace JSON\n- cURL reproduction\n- endpoint summaries\n\n## Why ReqScope?\n\nWhen an API request is slow or fails, logs are often not enough.\n\nReqScope shows what happened inside the request:\n\n```txt\nPOST /login 182ms\n\nfindUserByEmail      140ms\ncreateAccessToken     40ms\n```\n\nSo you can quickly answer:\n\n- Which step was slow?\n- Which step failed?\n- What request body came in?\n- What response went out?\n- Can I reproduce this request as cURL?\n\n## Installation\n\n```bash\nnpm install @abdiev003/reqscope\n```\n\n## Express usage\n\n```ts\nimport express from \"express\";\nimport {\n  reqscope,\n  reqscopeErrorHandler,\n  traceStep,\n} from \"@abdiev003/reqscope\";\n\nconst app = express();\n\napp.use(express.json());\n\napp.use(\n  reqscope({\n    enabled: process.env.NODE_ENV !== \"production\",\n    slowRequestThreshold: 300,\n    slowStepThreshold: 100,\n    endpointPrefix: \"/__reqscope\",\n    maxPreviewSize: 5000,\n    maxTraces: 100,\n    sensitiveFields: [\"password\", \"token\", \"secret\"],\n  }),\n);\n\napp.post(\"/login\", async (req, res, next) => {\n  try {\n    const user = await traceStep(\"findUserByEmail\", async () => {\n      return db.user.findUnique({\n        where: { email: req.body.email },\n      });\n    });\n\n    const token = await traceStep(\"createAccessToken\", async () => {\n      return createToken(user);\n    });\n\n    res.json({ user, token });\n  } catch (error) {\n    next(error);\n  }\n});\n\napp.use(reqscopeErrorHandler());\n\napp.listen(3000);\n```\n\n## Dashboard\n\nReqScope exposes trace data from your app:\n\n```txt\nGET /__reqscope/traces\nGET /__reqscope/clear\n```\n\nRun the dashboard:\n\n```bash\nnpm run dev:dashboard\n```\n\nBy default, the dashboard connects to:\n\n```txt\nhttp://localhost:3000\n```\n\nYou can change it with:\n\n```env\nVITE_REQSCOPE_API_URL=http://localhost:4000\n```\n\n## Options\n\n| Option | Type | Default | Description |\n|---|---:|---:|---|\n| `slowRequestThreshold` | `number` | `300` | Marks a request as slow when total duration exceeds this value in ms. |\n| `slowStepThreshold` | `number` | `100` | Marks a traced step as slow when duration exceeds this value in ms. |\n| `endpointPrefix` | `string` | `/__reqscope` | Prefix for internal ReqScope endpoints. |\n| `sensitiveFields` | `string[]` | common secrets | Fields to redact from previews. |\n| `maxPreviewSize` | `number` | `5000` | Maximum serialized preview size. |\n| `maxTraces` | `number` | `100` | Maximum number of traces stored in memory. |\n\n## Sensitive data masking\n\nReqScope redacts sensitive keys by default:\n\n```txt\npassword\ntoken\nsecret\nauthorization\ncookie\nset-cookie\napi_key\naccess_token\nrefresh_token\n```\n\nExample:\n\n```json\n{\n  \"email\": \"ali@example.com\",\n  \"password\": \"[REDACTED]\"\n}\n```\n\nYou can add custom fields:\n\n```ts\nreqscope({\n  sensitiveFields: [\"email\", \"phone\"]\n});\n```\n\n## Development\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nRun the example API:\n\n```bash\nnpm run dev:example\n```\n\nRun the dashboard:\n\n```bash\nnpm run dev:dashboard\n```\n\nBuild the SDK:\n\n```bash\nnpm run build -w packages/sdk\n```\n\n## Test requests\n\n```bash\ncurl http://localhost:3000/\n```\n\n```bash\ncurl http://localhost:3000/slow\n```\n\n```bash\ncurl http://localhost:3000/error\n```\n\n```bash\ncurl -X POST http://localhost:3000/login \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer super-secret-token\" \\\n  -d '{\"email\":\"ali@example.com\",\"password\":\"secret123\"}'\n```\n\n## Current status\n\nReqScope is currently an MVP focused on local development.\n\nSupported:\n\n- Express\n- manual step tracing with `traceStep`\n- local in-memory traces\n- local dashboard\n\nNot yet supported:\n\n- production storage\n- authentication\n- team sharing\n- NestJS/Fastify/Django integrations\n- automatic ORM tracing\n","readmeFilename":"README.md"}