@errpulse/node
Advanced tools
+96
| <p align="center"> | ||
| <img src="https://img.shields.io/badge/ErrPulse-Node.js%20SDK-f43f5e?style=for-the-badge&labelColor=09090b" alt="@errpulse/node" /> | ||
| </p> | ||
| # @errpulse/node | ||
| Backend error monitoring SDK for Node.js, Express, and Next.js. Part of [ErrPulse](https://github.com/Meghshyams/ErrPulse) — the error monitoring tool that runs with one command. | ||
| ## Installation | ||
| ```bash | ||
| npm install @errpulse/node | ||
| ``` | ||
| ## Quick Start | ||
| ```ts | ||
| // Zero-config — auto-captures uncaught exceptions, rejections, console.error | ||
| import "@errpulse/node"; | ||
| ``` | ||
| That's it. Errors are sent to `http://localhost:3800` by default. | ||
| ## Express Integration | ||
| ```ts | ||
| import express from "express"; | ||
| import { init, expressRequestHandler, expressErrorHandler } from "@errpulse/node"; | ||
| init({ serverUrl: "http://localhost:3800", projectId: "my-api" }); | ||
| const app = express(); | ||
| app.use(expressRequestHandler()); // Track all requests — add first | ||
| // ... your routes ... | ||
| app.use(expressErrorHandler()); // Catch route errors — add last | ||
| ``` | ||
| ## Next.js Integration | ||
| ```ts | ||
| import { withErrPulse } from "@errpulse/node"; | ||
| export const GET = withErrPulse(async (req) => { | ||
| const data = await db.query(); | ||
| return Response.json({ data }); | ||
| }); | ||
| ``` | ||
| ## Manual Capture | ||
| ```ts | ||
| import { captureError, captureMessage } from "@errpulse/node"; | ||
| captureError(new Error("Payment failed"), { userId: "123" }); | ||
| captureMessage("Deployment started", "info", { version: "2.0" }); | ||
| ``` | ||
| ## What Gets Caught | ||
| | Error Type | How | | ||
| | ---------------------------- | -------------------------------------- | | ||
| | Uncaught exceptions | `process.on('uncaughtException')` | | ||
| | Unhandled promise rejections | `process.on('unhandledRejection')` | | ||
| | Express route errors | Error handler middleware | | ||
| | Next.js API route errors | `withErrPulse()` wrapper | | ||
| | `console.error` calls | Monkey-patch | | ||
| | Memory warnings | Periodic `process.memoryUsage()` check | | ||
| | All HTTP requests | Request handler middleware | | ||
| ## Configuration | ||
| ```ts | ||
| import { init } from "@errpulse/node"; | ||
| init({ | ||
| serverUrl: "http://localhost:3800", | ||
| projectId: "my-api", | ||
| enabled: true, | ||
| sampleRate: 1.0, | ||
| captureConsoleErrors: true, | ||
| captureUncaughtExceptions: true, | ||
| captureUnhandledRejections: true, | ||
| monitorMemory: true, | ||
| memoryThresholdMB: 512, | ||
| beforeSend: (event) => event, // Modify or drop events | ||
| }); | ||
| ``` | ||
| ## Documentation | ||
| - [Full SDK Docs](https://github.com/Meghshyams/ErrPulse/blob/main/docs/sdks/node.md) | ||
| - [GitHub Repository](https://github.com/Meghshyams/ErrPulse) | ||
| ## License | ||
| [MIT](https://github.com/Meghshyams/ErrPulse/blob/main/LICENSE) |
+2
-2
| { | ||
| "name": "@errpulse/node", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "ErrPulse Node.js backend SDK — catch every backend error automatically", | ||
@@ -49,3 +49,3 @@ "license": "MIT", | ||
| "vitest": "^2.1.8", | ||
| "@errpulse/core": "0.1.1" | ||
| "@errpulse/core": "0.1.2" | ||
| }, | ||
@@ -52,0 +52,0 @@ "peerDependencies": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
149909
1.87%9
12.5%0
-100%97
Infinity%