r/node

▲ 78 r/node

God damnit, no stability

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 ? 🤪

reddit.com
u/GhostLexly — 4 days ago
▲ 0 r/node

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

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?

reddit.com
u/kumard3 — 5 days ago
▲ 2 r/node+1 crossposts

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

I've known about Zod, a JavaScript/TypeScript schema validation library, for a while, but I underestimated the size of its ecosystem. After using it for some form validation in React, I thought I'd see how well it integrated with Express. Sure enough, there were several middleware libraries for Zod + Express, so I decided to give one a try. I went with express-zod-safe because it fit my existing setup with very little effort.

Boom, that let me remove roughly 150 lines of custom validation and typing code. For context, the template created by express-generator-typescript is a simple CRUD app with four API endpoints. I hadn't realized how much boilerplate I'd written just to validate objects in the route handlers, including validator functions and some custom request/response types. I also replaced my environment variable validation code with Zod.

Express has been around for a while, but I still find it useful for small projects and demos. If you'd like a quick way to spin up an Express + TypeScript project, check out express-generator-typescript.

github.com
u/TheWebDever — 5 days ago
▲ 0 r/node

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

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.

u/KalamKiTakat — 5 days ago
▲ 5 r/node

pm2 monitoring

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)?

reddit.com
u/Zealousideal-Fix-527 — 7 days ago
▲ 9 r/node

Snr FE Dev looking to branch to Full Stack

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!

reddit.com
u/HawkAsAWeapon — 12 days ago
▲ 21 r/node+1 crossposts

Openship is a self-hosted deployment platform that lets you own the whole stack (14k stars)

Vercel and Netlify are great until they're not. You hit the usage cap, or your bill doubles, or you need something they just don't support. And suddenly you're locked in.

Openship gives you the same push-to-deploy experience, except it runs on your own servers.

You connect your repos, set up environments, and it handles builds, deployments, rollbacks, all from a dashboard that actually looks modern. Not some dusty self-hosted admin panel from 2014.

It supports Docker containers, static sites, and full-stack apps. Preview deployments work. Custom domains work. The basics are all covered.

The honest part: if you're a solo dev shipping a side project, Vercel's free tier is probably still easier. This is for teams that want full control or companies that can't send their code through someone else's infrastructure.

70+ contributors. TypeScript codebase. Actively maintained with the last release just days ago.

https://github.com/oblien/openship

Metric Value
Stars 14,260
Forks 1,300
Last release Latest (2026-09-27)
Contributors 70+
Languages TypeScript 93.7%, MDX 3.7%, CSS 0.6%
u/company_url_finder — 13 days ago