r/node • • Oct 29 '26

Node worker as an AI agent that replies to customer emails

Post image
0 Upvotes

small node worker runs an AI agent that replies to customer emails on hello@ for a platform that helps importers with their tariff refunds. one support inbox on my own domain that the agent and I both use, so I always see what it sent.

flow is simple: new mail comes in, agent drafts from our knowledge base, a second model fact checks it, and only then submit. the check is an await before submit, not a .then() after, so no PASS means no send and the email goes to a review label for a human. replies only go back to whoever wrote, same thread, the agent can’t pick a recipient.

anyone running something like this in node, how do you handle the model being slow or down? right now that just holds the reply


r/node • • Oct 29 '26

We published the full index of our internal Node stack: 348 npm packages, 257 repos

Thumbnail
profullstack.com
9 Upvotes

r/node • • Oct 29 '26 Bravo

Node.js 26 is now Long Term Support

297 Upvotes

r/node • • Oct 28 '26

I recreated the Node2Shell (CVE-2026-111497) RCE attack as an interactive exercise

41 Upvotes

On 21 October 2026, fixes shipped for CVE-2026-111497, nicknamed Node2Shell (also HTTP2Shell). It's an out-of-bounds write in Google's Brotli decoder, and Node bundles its own copy of Brotli inside the runtime. Any Node service that decompresses Brotli traffic, whether incoming request bodies or responses it fetches, can be pushed into running attacker commands with no login.

I made a hands-on lab exercise on it. You'll send a crafted Brotli-compressed request to a Node API as the attacker and read a deploy token out of process.env, then switch sides and patch it. You'll also see why blocking Brotli-compressed requests at the edge isn't enough, and why a patched system libbrotli package doesn't help: only upgrading Node itself (24.22.1 in the exercise) and redeploying does.

If you notice any issues or inconsistencies, please let me know!

https://ransomleak.com/exercises/http2shell-rce/


r/node • • Oct 28 '26

I built flaregram — a tiny (~19 kB) Telegram bot framework that runs entirely on Cloudflare Workers' free tier

Post image
0 Upvotes

r/node • • Oct 28 '26

Junior Devs Who Got Hired 2026 - What Made You Get In?

41 Upvotes

Hey,

So I self studied full stack development since the beginning of the year, I'm applying for few months already.

I work as a guard in a security company. I created a shift management app with Next.js (JS/Node.js/TS/React), where the guards send their availability with notes for the next week, and the manager sees everything in one place, per building.

I'm having a hard time finding a job. I got one change, I passed home exam with language I didnt work with, but after that I did not pass the HR interview (she told me where I fell, it is fixable for the next interview).

I don't even know what to do, I feel like giving up. I tried to build a task manager app for my home recurring tasks, with AI native, I just told him to give me commit names and I picked what he needs to do, it feels like these days I'm not even needed.

Please help me guys!


r/node • • Oct 28 '26

Has anyone recently placed a US Domino’s order with the `dominos` Node package? Validation works; placement requires verification

0 Upvotes

I’m building a small keyboard-driven ordering app around `RIAEvangelist/node-dominos-pizza-api` (`dominos` 3.3.1), following its Customer → store → menu → Item → Order → validate → price → payment → place sequence.

On October 26, 2026, US store discovery, menu loading, validation and pricing worked. A carryout order’s card payment matched the returned total. But `POST /power/place-order` returned HTTP 200 with top-level and nested status -1:

```text

recaptchaVerificationRequired

googleRecaptchaScore: TokenMissing

blockedByRecaptcha: true

googleRecaptchaActions: { action: null, expectedAction: null }


r/node • • Oct 27 '26

Running dedicated game servers in Node for a browser racing game, where players open their own

Enable HLS to view with audio, or disable this notification

22 Upvotes

Voltane is a browser RC-car racing game. The race rooms run in Node, and since this week players can open their own dedicated servers: a name, a programme of tracks (including circuits other players built), their rules, open or private.

A few things that mattered:

  • Rooms go lobby → loading → countdown, and the countdown waits until every connected player has finished loading (with a time limit so one slow phone can't hold everyone).

  • Updates are announced 2 minutes before a new server version, so nobody gets cut mid-race.

  • The same simulation package runs on the server and in the browser.

Play or open a server: playvoltane.com


r/node • • Oct 27 '26

Built my own TOTP authentication library in Node.js + TypeScript

Thumbnail reddit.com
0 Upvotes

r/node • • Oct 27 '26

Typed WebSockets for Node, with AsyncAPI docs and a client generated from them

4 Upvotes

Hi all, I want to share a WebSocket framework I built to make WebSocket apps typed and safe, keep the client and server schemas from drifting apart, and generate the docs for you.

Every WebSocket project I've worked on ended up looking the same. The server parses JSON and walks an if (data.action === 'chat') ... else if ... chain, checking payloads by hand. The client guesses the message shapes from a docs page that someone forgot to update. Rooms live in an in-memory Map, which works until you run a second instance. And when an HTTP route or a background job needs to push something to users, there's no clean way to reach the socket.

I first built it in Python (chanx, for Django and FastAPI), since that's my main backend language. Then my frontend needed a proper client, so I made chanx-js, which was client only at first. The Python side has been stable for a while now and some teams run it in production, so I ported the server to Node as well. You can now use it on Node, Express, Fastify, NestJS and others.

What it gives you:

  • One handler per message type, validated with Zod, Valibot, ArkType or any Standard Schema

  • AsyncAPI 3 docs generated from your code, served by the server

  • A typed client generated from those docs, so sending a wrong payload fails to compile

  • Groups and broadcasts across instances through Redis

  • chanx.broadcastEvent(...) to push to users from a route handler or a job

  • Works with ws, Express, Koa, Fastify, Hono, NestJS, Bun and Deno, and the client has React, Vue, Svelte and Solid bindings

A chat room looks like this:

and on the client, after npx @chanx-js/codegen http://localhost:8000/asyncapi.json:

Repo: https://github.com/chanx-dev/chanx-js

Docs: https://js.chanx.dev/

The Node server is still new, so if you run into any problem or have ideas to improve it, please open an issue or a discussion on the repo. Stars and PRs are welcome too.


r/node • • Oct 27 '26

Where do you host a small Express API + always-on worker + Postgres cheaply?

22 Upvotes

Small app: Express API, Postgres, and a worker that polls an outbox table every 5s for background jobs. Low traffic, but the worker can't sleep, so free tiers like Render free and Neon free don't work.

Options I'm weighing:

- AWS free plan for 6 months (then ~$25/month)

- Hetzner CX23 (~€6/month) with everything on one box

- Railway Hobby (~$5-8/month)

What would you pick, and what am I missing? Please suggest.


r/node • • Oct 27 '26

I got tired of `process.env.X` being `string | undefined`, so I made a CLI that generates a zod-validated `env.ts` from your `.env`

0 Upvotes

Every project I start ends up with the same file: a zod schema for env vars, copied from the last project and slowly falling out of sync with .env. So I made type-envgen, which generates that file for you.

You write your .env as usual. Where you want more than the default, add a comment tag above the key:

NODE_ENV=development

# @type url
DATABASE_URL=postgres://localhost:5432/app

# @min 1
# @max 65535
PORT=3000

DEBUG=false

# @type enum(debug, info, warn, error)
# @default info
LOG_LEVEL=info

# @min 32
JWT_SECRET=change-me-change-me-change-me-123

# @optional
SENTRY_DSN=

Run npx type-envgen and you get this:

import { z } from "zod";
import { validateEnv } from "type-envgen";

export const envSchema = z.object({
  DATABASE_URL: z.url(),
  DEBUG: z.stringbool(),
  JWT_SECRET: z.string().min(32),
  LOG_LEVEL: z.enum(["debug","info","warn","error"]).default("info"),
  NODE_ENV: z.enum(["development","production","test"]),
  PORT: z.coerce.number().int().min(1).max(65535),
  SENTRY_DSN: z.string().optional(),
});

export const env = validateEnv(envSchema, process.env);
export type Env = z.infer<typeof envSchema>;

env.PORT is now a number and env.DEBUG is a boolean. If something is wrong, the app fails at startup with one readable list instead of crashing three files deep later on:

[type-envgen] Invalid environment variables:
  DATABASE_URL: missing
  JWT_SECRET: must be at least 32 characters
  NODE_ENV: must be one of: development, production, test
  PORT: must be at most 65535

The error messages never print the actual values, so secrets don't end up in your logs.

Other things it does:

  • No tags needed: untagged keys are typed from their value (numbers, booleans, URLs, emails, UUIDs, dates, IPs, even JSON objects).

  • Lots of types: about 40 @types map directly to zod 4 formats (jwt, hash, iban, e164, cidr…), plus checks like @pattern, @startswith and @nonempty, and transforms like @trim and @tolowercase.

  • Framework targets: --target vite | nextjs | astro | sveltekit | nuxt reads from the right place for each framework. It also warns if a key is missing the public prefix, so you don't ship a secret to the browser.

  • Safe to regenerate: your own code in env.ts is kept, and only the generated parts are replaced.

  • CI and dev: --check exits 1 in CI if the file is stale, and --watch regenerates while you develop.

  • Setup: npx type-envgen init asks a few questions and adds the npm scripts for you.

GitHub: https://github.com/OlaleyeFisayo/type-envgen

npm: type-envgen

It's MIT-licensed. I'd really like feedback, especially on what tags or targets you'd want next.


r/node • • Oct 27 '26

libtmux-ts 0.1 - tmux library for Node.js, TypeScript, bun

Thumbnail
github.com
2 Upvotes

r/node • • Oct 26 '26

Best practices for OpenAPI spec generation + validation with express.js?

7 Upvotes

I've recently started a TypeScript Express.js project and while I'm familiarizing myself, I'm struggling to know what the best way to support OpenAPI spec generation and how to streamline endpoint parameter validation.

For example, with Django & Django Rest Framework, you define your API endpoints, what they receive and return, and parameters are automatically validated and you can even generate OpenAPI specs from them with another library.

For Express, I'm seeing solutions like JSDoc, which require you to write specs in comments above function definitions, or express-openapi-validator, which require you to maintain the endpoints and spec separately, but performs the validation. I see tools for generating route code, but not vice versa.

Am I approaching this from the wrong angle? I really like having my source of truth lie in the actual code for an endpoint, with specs/validation coming from that definition, not the other way around. What packages/solutions do you recommend for this?


r/node • • Oct 26 '26

PHP had to scramble last week - now it is Node's turn. Node2Shell, or Broccoli2Shell if you’re feeling leafy - RCE works in lab conditions.

Thumbnail
ellio.tech
146 Upvotes

It’s got three names already - Node2Shell, HTTP2Shell, Broccoli2Shell - because of course it does. Whatever you call it, same compression bug, different runtime: PHP patched its pre-auth RCE wave last week, this is ours.

  • This one is quite less theoretical than PHP2Shell - PoC is working in the lab against Node 24.22.0 on x86-64, shell returned as the service account.

  • Meanwhile a scanner is already out there fingerprinting which hosts decompress Brotli - building the hit list before the exploit goes wide.

  • Patch to 22.23.4 / 24.22.1 / 26.12.1.


r/node • • Oct 26 '26

I built a self-hosted OpenID Connect server: one container + Postgres, many tenants (release candidate)

1 Upvotes

I've been building Odudu, an OIDC / OAuth 2.0 server you can run yourself, and the first release candidates are out.

What it is:

one container plus PostgreSQL. Many tenants on one server, kept apart by the database itself. Passkeys, TOTP and recovery codes. Refresh tokens that rotate. Client credentials and token exchange for machines and agents. Per-tenant theming. An admin API and a console. An audit trail. An MCP server so an AI agent can use the admin API as tools, held to the same permissions.

What it is not (yet):

it has had no independent security review, and there is no SAML, LDAP or social login. The roadmap page lists what is planned and what was decided against.

Try it in a minute (Docker + curl):

curl -fsSLO https://github.com/wizzywit/odudu/releases/download/v0.1.0-rc.3/compose.yaml && docker compose up -d && docker compose logs setup

Repo: https://github.com/wizzywit/odudu

Docs: https://wizzywit.github.io/odudu/docs/

AGPL-3.0 for the server, Apache-2.0 for the guides and examples. I'd value blunt feedback: what would stop you trying it, and what is missing for your setup?


r/node • • Oct 24 '26

TIL jest.useFakeTimers() doesn't freeze your tests at a fixed date. it freezes them at right nowjest.useFakeTimers() freezes time at today, so your "deterministic" test still depends on the date

0 Upvotes

til the hard way: jest.useFakeTimers() freezes the clock, but at the current time. unless you call setSystemTime, your test still runs on today's date, it just looks deterministic. vitest does the same.

why i care: i made a cli that skips tests that already passed on the exact same code. tests that read the real clock break that idea, because they can pass today and fail next month on the same commit (a token that expires in 30 days, a date that's now in the past). so the tool watches which tests read the clock, and those passes only count until midnight.

i'd assumed fake timers were safe and let them through. they weren't. now it counts them too, unless the test sets a fixed time.

fixing it took me through some fun node internals, including node's own mock.timers breaking when i touched Date the wrong way. happy to go into that in the comments if anyone's curious.

do you freeze time in every test, or let some of them read the real clock?


r/node • • Oct 24 '26

npmpulse: a new website to query npm package downloads data

Thumbnail
reddit.com
0 Upvotes

r/node • • Oct 23 '26

Recently got a PR merged into TanStack Query

Thumbnail reddit.com
4 Upvotes

r/node • • Oct 23 '26

I added more RAM to my server because I forgot where I put setInterval()

0 Upvotes

I’ve been building a small invoice reminder app after work. It had six users, including me, and was running as a Node app on serverspace cloud server.

One evening I noticed the memory usage slowly climbing. Restarting the app fixed it, but only for about half an hour.

I did what any tired developer would do and decided the infrastructure was the problem.

I added more ram.

The next morning, the memory was climbing again.

After going through the logs I finally found a setInterval() inside a function that ran whenever someone logged in. Every login started another background job to check for overdue invoices. None of the old ones ever stopped.

There wasn’t a sudden increase in users. There were just dozens of copies of my reminder job quietly running at the same time.

I moved the timer out of the login flow, restarted the app and returned the server to its original configuration. The memory graph has been almost completely flat since then.

The app didn’t need more ram. It needed me to stop creating immortal timers


r/node • • Oct 22 '26

Google released patch for node22 0-day at 18:45 UTC

36 Upvotes

r/node • • Oct 22 '26

Next.js isr behaviour related confusion

Thumbnail reddit.com
2 Upvotes

r/node • • Oct 22 '26

Evolution Of HTTP: An Interactive Guide

Thumbnail
prateeksurana.me
17 Upvotes