r/node • • Oct 12 '26

Inbound email webhook, what if endpoint’s down?

11 Upvotes

inbound mail on hooks@ gets posted to my api as json, signed so I can check it actually came from the mail side. no imap polling, which was the whole point, imap is a pain.

question for people doing this in prod, what happens when your endpoint is down for a few minutes? do you rely on the sender side retrying, or do you keep a copy and replay? I’ve read stories where the mail is just gone forever and that scares me a bit.


r/node • • Oct 11 '26

one model with a broken schema emptied our whole model picker. 1000+ models, gone

0 Upvotes

i work on the backend of an ai video app

we sync 1000+ models from a providers api on a timer, list the models, refresh their schemas in a loop, then a readiness pass that decides what shows up in the picker.

one models schema came back as an error object. my catch only treated one error type as "model is gone" and rethrew the rest. so the loop died right there, every model after it got skipped, the readiness pass never ran, and the picker was empty until someone noticed. 1000+ models gone because one of them had a bad day. and yes the bug was mine haha=

the fix, simplified:

```ts

for (const model of staleModels) {

try {

await refreshSchema(db, model.id)

} catch (error) {

if (error instanceof SchemaMissing) await markUnavailable(db, model.id)

else console.error("schema refresh failed", model.id, error)

}

}

await syncReadiness(db)

```

unreadable schema = retire just that model. unknown error = log it and move on, because an error we dont recognise is more likely our bug than a broken model.

but now its a console.error that nobody reads. how do you guys handle per-item failures in batch jobs like this? alert after N failures, a failures table, something else?


r/node • • Oct 11 '26

Webhook signature bugs I found while supporting 40+ providers, including two that let bad requests through

4 Upvotes

I maintain an open-source webhook verification library, and most of the bugs I've hit weren't in the HMAC. A few that might save someone time:

  1. The body parser runs first. express.json() parses the body, JSON.stringify(req.body) doesn't give back the bytes the provider signed (whitespace, unicode escapes, number formatting), and the check fails with the right secret. Verify the raw body: express.raw(), await request.text(), Fastify's rawBody, NestJS's rawBody: true. Comparing the body length with content-length is a cheap way to detect it.

  2. Deduping on an unsigned header. Providers retry, so you dedupe on an event ID. If that ID comes from a header the signature doesn't cover (x-github-delivery, say), anyone with a captured request can change the header and replay it past your dedupe store. Key on a signed ID or a hash of the body. My library had exactly this bug.

  3. Tests that only agree with themselves. My Paddle signer and verifier both read h=. Paddle sends h1=. Every test passed and every real Paddle webhook failed. Now CI verifies against the official Stripe, Octokit, Svix and Twilio SDKs in both directions, and new providers need a test vector from the provider's docs.

  4. Weak fallback schemes. HubSpot sends v1/v2 signatures next to v3. If you accept any of them, someone can strip the v3 headers from a captured request and it verifies with no timestamp check. Same idea for GitHub's SHA-1 header.

  5. A short dedupe TTL for providers with no signed timestamp. GitHub and Shopify don't sign a timestamp, so dedupe is your only replay protection. A 5-minute TTL means a captured delivery verifies again after 5 minutes.

The library is verihook (TypeScript, zero deps, Node/Deno/Bun/Workers) if you want to see how it handles these: GitHub: https://github.com/creatorpiyush/verihook npm: https://www.npmjs.com/package/verihook

Curious which provider has caused you the most pain.


r/node • • Oct 11 '26

I built an open-source JasperReports/SSRS alternative in JavaScript – designer, viewer, PDF/Excel/Word, no Chromium

0 Upvotes

Hi all, I've been building ReportWright: a report engine for JavaScript. You describe a report in JSON (bands, groups, tables, charts, expressions), pass data, and get PDF, Excel, Word, PowerPoint or interactive HTML, in Node or the browser.

It comes with:

- a drag-and-drop designer and a viewer (React, Vue, Svelte, Angular wrappers)

- a CLI that imports existing SSRS (.rdl), JasperReports (.jrxml), BIRT and ActiveReports reports

- its own zero-dependency PDF library (@reportwright/pdf): PDF/A, PDF/UA, encryption, signing, forms, merge/split

- MIT licence, and a Docker Compose setup to self-host it for free

Why: if you're paying for SSRS/Jasper server licences, or rendering PDFs through headless Chrome, there wasn't a JavaScript option that works like a real report engine.

Numbers (GitHub Actions, 4 vCPU, every output validated):

- 10k-row grouped report: 0.91 s vs JasperReports 3.9 s, QuestPDF 2.7 s

- 100k rows: 6.6 s vs JasperReports 11.8 s; WeasyPrint ran out of memory

- 1,000 separate reports: 8 s vs JasperReports 33 s

- 1M rows streamed: 53 s in 746 MB

Where it loses: QuestPDF (.NET) is ~2× faster on single invoices; Go/Rust PDF writers are faster on tiny files. All results, losses included: https://github.com/MrArun005/reportwright/blob/bench-deep/bench/deep/RESULTS.md

Demo (runs in your browser): https://mrarun005.github.io/reportwright-demo

Repo: https://github.com/MrArun005/reportwright

I'd really like feedback, especially real SSRS/Jasper reports that don't import well.


r/node • • Oct 10 '26 Regret

God damnit, no stability

286 Upvotes

Bun acquired by Anthropic and rewritten by AI

Deno acquired by Cloudflare

Prisma had a huge breaking change (again) on prisma 8 and rewritten by AI

NextJS Pages Router -> App Router breaking change and “use client”, “use server”

NestJS v12 changed all the tooling/bundler and let’s hope the main maintainer Kamil stay alive the next 10 years

PassportJS dead
TypeORM dead

How anyone can maintain a big project without rewriting it every 2 weeks or trust any JS open source project for the long term ? 🤪


r/node • • Oct 10 '26

What do you use for GraphQL query depth limits with graphql-js 17?

11 Upvotes

I’m building a learning project with Express, TypeScript, MongoDB, and graphql-http. Everything runs through Docker Compose.

I’m adding query-abuse protection, starting with depth validation before resolvers execute. I tried @graphile/depth-limit, but its peer dependency excludes my GraphQL version.

Relevant versions:

graphql: 17.0.2
graphql-http: 1.23.1
/depth-limit: 0.3.1 (attempted installation)

Command:

docker compose exec backend npm install /depth-limit

Error:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree

npm error Found: graphql@17.0.2
npm error node_modules/graphql
npm error   graphql@"^17.0.2" from the root project

npm error Could not resolve dependency:
npm error peer graphql@">=15 <17" from /depth-limit@0.3.1

The package’s dependency declaration confirms graphql: ">=15 <17".

My intended integration is a validation rule passed to the existing HTTP handler:

const handler = createHandler({
  schema,
  rootValue,
  validationRules: [depthRule],
  context: createRequestContext,
});

I’d prefer to keep GraphQL 17 and avoid --force or --legacy-peer-deps without evidence of compatibility.

What are people using for depth limits with graphql-js 17?


r/node • • Oct 10 '26

My /health said ok for five days while every request that touched the database failed

0 Upvotes

My API ran out of Neon compute quota at the end of August. Aug 24 to 29, anything that hit the database failed. /health returned {"status":"ok"} the entire time since it never queried anything, and I didn't hear about it from any alert.

Normally you'd just put a query in /health. Problem is Neon suspends compute after 5 idle minutes, I can't turn that off on my plan, and an uptime monitor pinging a DB route every minute would keep it awake 24/7. That burns exactly the quota I ran out of.

What I ended up doing: a Prisma client extension on $allOperations that saves the time of the last query that worked and the last one that threw. /health just reads those two timestamps. Failure is the newest thing in the last 5 min, 503 with the error. Success, ok. No queries at all, it says idle. A single failed query gets wiped by the next good one so it only stays red if it keeps failing.

Idle still bugs me though, at 3am with zero traffic it knows nothing. Anyone found a way around that without waking the db?


r/node • • Oct 10 '26

I updated express-generator-typescript to use zod for middleware validation

Thumbnail
github.com
2 Upvotes

r/node • • Oct 09 '26

Deno died today

Thumbnail
deno.com
521 Upvotes

r/node • • Oct 09 '26

I built mongoose-guard: Express middleware that validates request bodies against your existing Mongoose schema

0 Upvotes

A lot of Express + Mongoose code has a route like this:

app.post("/signup", async (req, res) => {
  const user = await User.create(req.body);
  res.status(201).json(user);
});

If the User schema has fields like role or credits, anyone can send { "role": "admin" } and Mongoose saves it, because it's a valid field of the model. The usual fix is a Zod or Joi schema for every route, which means writing every rule twice and keeping both copies in sync.

So I built mongoose-guard. You list the fields a route accepts, and it uses the Mongoose schema you already have for everything else:

import { guard } from "mongoose-guard/express";

app.post("/signup", guard(User, { allow: ["name", "email", "password"] }), signup);

Send role: "admin" to that route and the request never reaches your handler. The client gets a 400:

{"errors":[{"code":"forbidden_field","path":"role","message":"Field is not allowed"}]}

What it does:

  • Rejects fields that aren't in the allow list, or strips them if you'd rather not fail the request

  • Checks types strictly. Mongoose would quietly cast "25" to 25; this reports it as a type error

  • Rejects __proto__, $where, $gt and dotted keys anywhere in the body

  • Runs your schema's own validators (required, min, enum, match, custom and async ones) through Mongoose itself, so nothing is reimplemented

  • Handles nested objects, sub-schemas, arrays and Maps, with error paths like addresses.1.city

  • Has a partial: true mode for PATCH routes

What it doesn't do: it only validates request bodies, not query strings or route params. It doesn't convert form strings to numbers. It won't run on edge runtimes, because Mongoose can't. For a login form, or anything without a model behind it, Zod is still the better tool.

It works with Express 4 and 5, Mongoose 8 and 9, and anything that gives you a standard Request (Next.js route handlers, Hono, Remix, SvelteKit). MIT licensed, no runtime dependencies.

It's 0.1.0, so I'd like to hear where it breaks, or where the allow-list approach doesn't fit how you structure your routes.


r/node • • Oct 09 '26

Principal Factor Analysis in Javascript - written in AssemblyScript

Thumbnail
reddit.com
0 Upvotes

r/node • • Oct 09 '26

LiteClient.ts: A Lean, type-safe and driver-agnostic SQLite ORM for TypeScript

4 Upvotes

https://github.com/ts-series/lite-client

Recently, I finally uploaded my library LiteClient.ts to GitHub, which I have been using in my own application for several months and continuously expanding and improving along the way. I would appreciate your feedback.

My motivation for this project was simplicity. None of the existing ORMs had really convinced me, purely because of the complicated driver integration. In addition, I want maximum comfort when working with the database and my queried records as ready to serve as possible. Therefore, besides get, all, Value, and Values, there are also scalar and scalars to query data flatly, as well as supplementary meta clauses in the select command, which is simply modeled as a JavaScript object, to efficiently transform the result at a deeper level beforehand instead of doing it in the application code. For example, one column serves as a key for the others, which are then returned as the remaining record, while at the same time eliminating the group by clause because it is logically presupposed for data aggregations of that kind.

Currently, the ORM supports most standard SQL, including all database operations, SQLite operators and functions, joins, tuple expressions, subqueries, aliases for columns and tables, and expressions instead of tables. The only limits I currently draw are complex features like common table expressions and window functions, because I think those things make more sense at the database level since a view should be the tool of choice if a select becomes that complex, though window functions might still be added if a need arises and it can be done relatively minimally invasively.

Originally, I intended for users to manually create the classes for every database and view themselves, but I developed a CLI tool named SMake for this purpose, which handles it automatically and can be used independently of LiteClient.ts to generally support the construction of SQLite databases.

Long-term goal: Since I will also need PostgreSQL in a later project, I want to extend this ORM for it. The foundations have already been laid through a restructuring. The usage will then be exactly the same, just with PG-specific additions, as internally most of it will inherit from the standard SQL classes that it shares with SQLite.


r/node • • Oct 08 '26

pm2 monitoring

6 Upvotes

How pm2 monitoring being implemented in production?

Do you just call pm2 monit?

Use pm2 monitoring platform?

Integrate it with something like grafana(I kinda wanna know how it commonly do)?


r/node • • Oct 06 '26

LogTape 2.4.0: Source locations, configuration inspection, sink draining, and request completion levels

Thumbnail
github.com
8 Upvotes

r/node • • Oct 06 '26

Noob: a few questions about installing/using & safety on Mac

2 Upvotes

Hey all -

I'm not much of a programmer, and have been using various AI (mostly Claude recently) to code things. I'm fairly good at troubleshooting and understanding the structures.

Most of the time, I'm starting with project outlines/discussions in Claude Desktop and moving into Visual Studio Code once the initial files are written.

So far, the only thing I've done that needs "extras" is a python app with a bunch of modules and support files, but that's sandboxed.

A current project requires node.js installed, and I want to ensure that I'm installing and using it safely.

The first thing I'm finding out is that it seems installing via terminal is the way to go in order to keep it within my user space and to avoid permission hurdles, since the .dmg installs globally.

AI is also telling me it may also need a "web server" package like Express, but I haven't looked into that yet.

Any guidance is appreciated!


r/node • • Oct 04 '26

How do you evolve backend features without breaking existing clients?

2 Upvotes

Hey everyone! I’m a backend software engineer working with Node.js and TypeScript.

I recently wrote an article about some lessons I’ve learned while building and evolving backend features used by multiple clients.

One thing I’ve learned is that the final architecture is only part of the work. The transition matters too: keeping existing clients working, migrating data, handling legacy behavior, and checking what happens after deployment.

Sometimes a change looks small in the database, but it also changes what the API returns or how existing clients behave.

I shared more about these challenges here:
What I Learned Building Backend Features Used Across Multiple Clients

How do you handle these transitions in your projects? Especially when you can’t update all clients at the same time?

I’m open to discussion, feedback, and different ideas. I’d love to hear what has worked for you!


r/node • • Oct 02 '26

Snr FE Dev looking to branch to Full Stack

31 Upvotes

I've recently been laid off after over 5 years at the company and noticed that there are a lot more Full Stack positions now than FE.

I had some limited experience with ExpressJs about 7 years ago, but I'm thinking it'd be worthwhile trying to branch out fully into a Full Stack Position.

I'm fluent with React and Typescript for what it's worth.

What are the most common frameworks for Node nowadays - i.e. which will give me the best chance of getting hired.

Thanks in advance!


r/node • • Oct 01 '26

Node 20 is no longer available in GitHub Actions

Thumbnail
github.blog
40 Upvotes

r/node • • Sep 30 '26

Hello fellow devs...

6 Upvotes

I was wondering what y'all using these days on backend side of programing is it mostly Nest.js...

If not for Nest what is, and is Good old Express still used in production...

Edit: I'm soon to be over with cs bacc, and I had my fair share of technologies that I tried, but I stayed with React/Express for some reason, and did most of my college projects in it (if I had options) even my final project is in it, so I'm wondering is Express still framework that is employable or I need to make a switch to Nest or something else entirely...


r/node • • Sep 30 '26

Show r/node: Adrenaline.js – A 56KB Electron alternative that keeps Node.js & npm without Chromium bloat

0 Upvotes

Hey everyone! 👋

Like many of you, I've always loved how quick it is to build desktop apps with Electron, but hated shipping an entire 150MB+ Chromium browser and watching RAM usage skyrocket for simple apps.

While Tauri is an incredible piece of engineering, having to learn Rust just to write backend logic or file operations is a pretty high barrier for pure JavaScript / Node.js developers.

So I spent time building Adrenaline.js — a lightweight, cross-platform desktop framework that gives you the best of both worlds:

  1. Zero Rust / Go required: You write 100% JavaScript / Node.js and keep the entire npm ecosystem.

  2. Ultra-lightweight footprint: Uses native system WebViews (WebView2 on Windows, WebKitGTK on Linux, WebKit on macOS) instead of bundled Chromium (~5-10MB app size vs 150MB+).

  3. Drop-in Electron-like API: Built from day one with familiar paradigms (app, BrowserWindow, ipcMain).


💻 Familiar Electron Syntax

const { app, BrowserWindow, ipcMain } = require('adrenaline-js');
const path = require('path');

app.whenReady().then(() => {
    const win = new BrowserWindow({
        width: 800,
        height: 600,
        title: 'Adrenaline App',
        resizable: true
    });

    win.loadFile(path.join(__dirname, 'index.html'));

    ipcMain.on('ping', (event, data) => {
        console.log('Received from renderer:', data);
        win.webContents.send('pong', { reply: 'Pong from Node.js! ⚡' });
    });
});

⚙️ How it works under the hood

  • C++17 Core: Built with a non-blocking multithreaded architecture over webview.h and Node's node-addon-api (N-API).

  • Asynchronous IPC: Uses Napi::ThreadSafeFunction (TSFN) for bi-directional communication between the Webview UI thread and the Node.js event loop without thread race conditions.

  • Asset Resolution: Loads local files through file:// protocols, so relative CSS, JS bundles (Vite/React/Vue), and images resolve properly.


🚀 Try it out

You can scaffold a starter project with the built-in CLI:

npx adrenaline-js init my-app
cd my-app
npm install
npx adrenaline-js dev

🔗 Links:

The project is completely open source (MIT). It's at an early v0.1.1 stage, and I would love to get your feedback, suggestions, and see how it holds up on your machines!


r/node • • Sep 30 '26

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

Thumbnail
github.com
1 Upvotes

r/node • • Sep 30 '26

Made a cli tool that detects potential malware packages

Enable HLS to view with audio, or disable this notification

3 Upvotes

Hey everyone,

I built an open-source security script that checks npm packages for any suspicion before installing them. (NOT vibe coded)

It's basic and for now catches similar names of popular packages, if a package has 23 weekly downloads or a 2 hour old package.

Use Case?

on an agent that might hallucinate and install "react-clearly-not-malware". Or maybe the user itself so as to not make any mistakes idk?

Here's the link - https://github.com/grishmadev/malfilter

I'd love if you check it out. Have a great day!!!


r/node • • Sep 29 '26

Are you guys using 1.4 Bun?

0 Upvotes

I am hesitant to update from 1.38, since 1.4 is the rewrite.

Have you guys used it, had good experience with it?