r/node

I made a small Bash wrapper that reduces successful Maven output by 99.7%
▲ 54 r/node+2 crossposts

I made a small Bash wrapper that reduces successful Maven output by 99.7%

Successful Maven builds can produce thousands of lines that mostly confirm routine lifecycle steps.

That output is noisy when working in a terminal, clutters CI logs, and becomes especially expensive when build output is passed to a coding agent.

I built mvn-lite, a small deterministic Bash wrapper that keeps successful Maven output to one line while preserving the original exit code and complete raw log.

On a real four-module application:

  • Standard Maven output: about 6,753 bytes
  • mvn-lite output: 16 bytes
  • Result: PASS · 3.944 s
  • Reduction: more than 99.7%

Failures still return a nonzero exit code and show bounded diagnostics, while the full unmodified Maven output remains available in the raw log.

For example, an invalid lifecycle error was reduced by 91.6% while retaining the actual Maven error.

There is no LLM summarization, API key, or Maven extension involved. It is just a local Bash wrapper with deterministic text extraction.

Source and script: https://github.com/ejboy/agent-scripts

Benchmark details and design notes: https://pvrlabs.xyz/articles/introverted-maven.html

I’d be interested in feedback on Maven failure cases where compact output could hide something essential.

u/fykup — 2 days ago
▲ 3 r/node+1 crossposts

made a small supervisor for stdio MCP server processes, no dependencies

I've seen a bunch of people talking about the same problem with MCP: orphaned child processes that don't die when they're supposed to. it's not just one person's issue either, the TypeScript SDK has an open issue where closing the transport doesn't kill the process tree, Codex CLI has one about orphaned npx-spawned MCP servers piling up over time, context7-mcp has one where the process just doesn't exit when its parent dies. all different projects, same root cause: something like npx forks the real server as its own child, and killing the wrapper's PID doesn't touch it.

I looked for a small library that just handled this and couldn't find one. I pulled this out of a bigger project I'm working on because it felt like something worth having on its own: https://github.com/ImDeadWeight/stdio-supervisor

what it does:

  • restarts a crashed process with capped backoff
  • kills the whole process tree on stop, not just the direct child (taskkill /T on windows, process group signaling on posix)
  • handles the .cmd shim and argv quoting for npx/npm on windows
  • frames stdout into whole lines
  • onSpawn fires on start and on every crash-restart, so you get a clean signal to redo a handshake against the new process
  • optional timeout watchdog on send() for when a process goes quiet

no protocol opinion, no daemonizing, no CLI. just the part where you spawn and keep a handful of stdio children alive without it silently breaking on you.

MIT. let me know if you find anything wrong with it.

Edit: a word

Edit: Now imports execFile, fs, path, and StringDecoder from Node. Also imports crossSpawn.

u/ItsDeadWeight — 1 day ago
▲ 31 r/node+3 crossposts

PeekM2: A real-time dashboard/viewer for your PM2 processes

Note: I'm just a beginner, don't bash too hard on me :/. AI wasn't used to write this post at all and I'd love if you'd take a minute and check the project out!

AI was used to lend me a hand me during the dev of the project, but it wasn't used extensively and most of the UI is just shad/cn, it was used mostly to help me learn Svelte as it's my first time using it :P

Also, for anyone that isn't inside the JS/TS ecosystem or just don't know what PM2 is, it's just a process manager, allows you to control all of your Node/Bun/Deno processes (or even other interpreters) and auto-start them on boot. Find more about it here: https://pm2.keymetrics.io/

Project Repo: https://github.com/AngelCMHxD/PeekM2

Live demo: https://peekm2.angelcmh.com/

---

I've been looking for PM2 dashboards for quite a while and I've been able to find quite a lot of options, however, none of them were quite what I was looking for.

The official one has a LOT of features, though mostly ones that I don't need, and the only plan with a fixed/public pricing is $39 a MONTH, which is just too much for what I was looking for, and especially for hobby projects.

And for the open-source ones, some of them were too complex to setup, like I don't want to setup a whole PostgreSQL instance just for a PM2 dashboard. And others were over-complicated, I don't really need an user management feature other than just an admin/master password, if I didn't have a dashboard I'd have to give the other maintainers access to the whole daemon anyways. (Though right now you can set up multiple instances, so you can handle access that way too)

So, for mine I built a historical CPU/RAM usage history chart, logs, basic controls to restart/stop/delete processes, and a small uptime chart (that probably needs to be reworked because it only checks every 5 mins, and for it to be reliable it should check WAY more frequently)

Now, I do have other features in mind that I could implement and have them in mind, like these:

  • Discord (or other) webhooks to notify about process changes or downtime.
  • Fix the uptime thing I mentioned before.
  • Add a way to check historical data from other than the last 24h.
  • Related to the one above, limit the amount of historical data stored, as it's currently uncapped and we only use the last 24h, so keep only what's needed
  • Maybe add a way to see the process env variables?

This list is not exhaustive though, and I'm quite open for feedback, even if it's the user management thing I mentioned before that I didn't need, I'll just find a way to make it unobtrusive for anyone that may not want it.

The main point of the project is just keeping it simple for anyone that doesn't want that much, but I could add other features as long as they don't impact the simplicity for anyone that don't want them. Just keeping the "barrier of entry" as low as possible.

I've also deployed a "demo" instance so you can see how it currently looks like, and I've said before, I'm open to feedback!

If you like the idea, please star the repo ;D! It's my first time doing a project and posting it on things like Reddit, I'm just a beginner at these things

Edit: Fixed the formatting... so sad that it didn't worked at first :/

2nd Edit: Also, I'd love to promote Hack Club! It's an amazing non-profit dedicated to incentivize programming for teenagers (13-18 inclusive) and overall just doing cool projects while getting rewards. This project was made/submitted to one of their programs as I'm a teenager myself :D

u/Anglotx — 2 days ago
▲ 0 r/node

Trying a different approach to i18n on the server — no keys, no catalog files. Feedback welcome

Working with the team behind https://aurorah.ai/i18n, so take this with that in mind — but I'd genuinely like opinions from Node folks.

The idea: skip message IDs entirely. You write i18n.t\Your order ${orderId} has shipped`` — the string itself is the key, and translation happens automatically at runtime (fast draft first, refined LLM pass replaces it in the background). Works server-side for emails, API messages, whatever. Free, no API key or signup, and there's a fully offline mode.

There's a Node example at aurorah.ai/i18n if you want to poke at it. Curious what this sub thinks of runtime translation as a concept — what would stop you from using something like this in production?

reddit.com
u/elcityzen — 1 day ago
▲ 0 r/node

Should I continue with authentification or CSS?

Hello,

I am an aspiring developer and right now I am working as a conversion tracking specialist.

I just finished the Net Ninja's crash Node JS course on YouTube.

He has a separate course for authentification.

Should I continue with authentification or start CSS?

My gut is telling me to go for CSS since I can practice more of my skills.

What do you think?

reddit.com
u/Nice_Pen_8054 — 2 days ago
▲ 319 r/node

Why is JavaScript criticized so much for backend development?

I've seen some developers say that we should stop using js on the server, but I rarely see the same criticism directed at python.Honestly, js is pretty fast, especially with node.js, and the backend ecosystem is really solid. There are great frameworks like nest and fastify, and typescript gives you static typing, which makes larger projects much easier to maintain.I'm not saying node is perfect or the best choice for every backend, but I don't really understand why js gets so much criticism while python seems to get a pass.What am I missing?

reddit.com
u/Minimum-Ad7352 — 5 days ago
▲ 2 r/node

Do small Node.js services need process-local error grouping?

When the same database error happens 20 times, sending 20 notifications creates noise. Process-local fingerprinting with a count and cooldown helps, but it does not deduplicate across replicas.

For a service with one or two instances, is that useful enough to ship, or is cross-replica grouping essential? What metadata makes a grouped alert actionable?

I’m building an open-source Node package around this and want to validate the design before adding more integrations.

reddit.com
u/UkrMalt — 4 days ago
▲ 19 r/node

For a new Node.js library, is dual ESM and CommonJS support still worth it?

I’m preparing a public beta of a TypeScript package. Supporting both import and require widens compatibility, but conditional exports, declaration paths, and the dual-package hazard add release work.

For a new infrastructure library in 2026, would you ship ESM-only, dual builds, or an ESM package with a CommonJS wrapper? Which consumer environments still make dual support worth it, and which compatibility checks belong in CI?

reddit.com
u/UkrMalt — 6 days ago
▲ 13 r/node+3 crossposts

Announcing ink-frame: Grids for Ink!

https://github.com/oliveryasuna/ink-frame

Ink's own box borders are fine for a single box. Put two of them next to each other and the seam between them comes out as ││, two parallel lines instead of one shared edge. That's because a box border is one unbroken line and there's nowhere to hang a or a part-way along it. ink-frame sidesteps that by painting every border into a single character grid and resolving each cell once, so a spot where four boxes meet becomes a and a T-junction becomes a , , and so on, without you ever writing those characters yourself.

Background: I recently wrote this for a private project, and I thought it was useful enough to share. I hope you find it useful too!

u/RepresentativeNo42 — 5 days ago
▲ 67 r/node+1 crossposts

WARNING: I pretty sure ioredis is hacked

https://ioredis.com

There are some strange behaviors on this page.

  1. If you click logo in top left corner, you are redirected to some random page, than other random page, than you finally land to something random.

  2. If you click "guide" you are redirected to opera gaming browser page. Same applies to many links on website.

  3. Download button leads to some very strange page which instructs you to run command and enter system password: https://filebanchaflow.com/oo2/ (at least it did few moments ago)

If you inspect download button element, it is <a> which leads to https://github.com/redis/ioredis.git , but clicking it gets you to something different.

Whole page is done in wordpress, so it seems to me that their wordpress server got hacked. I hope it is just that.

reddit.com
u/Zogid — 7 days ago
▲ 0 r/node

Is there an alternative to fetch that may circumvent a 403 response?

To minimize browsing I run a script that fetches the comics I hope will be funny. For years I could do an HTTP fetch of a URL with a fixed address that pointed to the day's cartoon. Starting a year ago that stopped working on gocomics.com. I rewrote the script to use node to run fetch on that URL; the URI of the cartoon was fetchable via HTTP. Starting today that fetch gives me a 403 error. I can access it in a browser without logging in (I have no account anyway) or solving a CAPTCHA or other explicit test; I don't even get that CloudFlare thing. Am I out of luck?

reddit.com
u/ArthurPeabody — 8 days ago
▲ 232 r/node+19 crossposts

Walks the full cmd/compile pipeline in order: package names, data structures, and the SSA construction that drives inlining, escape analysis, bounds-check elimination, and register allocation, with flags to observe each phase directly.

This one took a while, it's probably the longest thing I've written on this blog. I wanted to do a proper end-to-end walkthrough of cmd/compile: real package names, real data structures, diagrams for the AST and SSA CFG, and the flags you actually need (-m, -m=2, GOSSAFUNC, -S) to observe each phase yourself rather than just take my word for it.

Covers the full pipeline: lexer → parser → type checker → IR lowering → SSA construction → optimization passes (inlining, escape analysis, BCE, nil check elimination, register allocation) → architecture-specific code emission.

Hope it's useful — happy to answer questions or push back on anything that looks wrong.

blog.gaborkoos.com
u/OtherwisePush6424 — 8 days ago
▲ 11 r/node+1 crossposts

Hi everyone,

I’m looking for guidance on how to transition from building basic CRUD apps to more complex, real-world systems.

My Current Experience: I’ve built a blog ecosystem consisting of three parts:

  1. Main App: A frontend where users view posts and authorized users can manage comments. code
  2. Author App: A dedicated portal for authors to authenticate, create, and publish content. code
  3. API: A central backend managing all business logic. Code

I have built this architecture using Express.js with PostgreSQL, and I have also built a similar version using Next.js.

The Goal: I want to dive deeper into complex application architecture. My current plan is to:

  1. Watch a high-level project tutorial.
  2. Build the project alongside the tutorial, then build it start to finish without looking at the tutorial.
  3. Build a similar, original project from scratch to solidify the concepts.

My Questions:

  • Is this a good learning approach, or should I change my strategy?
  • Should I focus my practice on Next.js or a decoupled Express + React setup to best prepare for the industry?
  • What are the "must-know" concepts for building complex, production-ready apps?

Thanks for the help!

u/zahirulopel — 8 days ago
▲ 16 r/node

Am I wrong that a 429 shouldn't count against a job's retry budget?

Been going back and forth on this one and I want to know if I'm alone in it.

Most retry implementations I've seen (BullMQ, hand-rolled wrappers, most of the managed stuff) treat every failed attempt identically. Job comes back non-2xx, attempt counter increments, backoff applies, after N attempts it's in the DLQ.

But a 429 isn't a failure, nothing broke. The downstream is telling you exactly when to come back and usually handing you a Retry-After header to do it with. If you burn an attempt on it, sustained rate limiting at a provider will walk perfectly good jobs into the DLQ while your actual error budget (the one meant for 500s, timeouts, connection resets) never gets spent on what it's for.

So I've been treating 429/503/529 as a defer rather than a failure: honor Retry-After, requeue, don't decrement. Works, but it opens two things I don't have clean answers to.

First, you need a ceiling or the queue never drains. A provider that 429s indefinitely will requeue that job forever. I've landed on two different ceilings: a wall-clock deadline (dead 24h after it's due, regardless of how it got there) and a separate max defer count. Blowing the defer ceiling dead-letters the job under its own reason rather than folding it into "out of retries" which matters because those are different failures. One says the downstream is broken, the other says it's been unusable long enough that it may as well be. At a certain point temporarily unusable === broken.

Second, deferred jobs are invisible. They aren't failing, so they don't trip anything you're monitoring, and you can sit on a queue that isn't draining and looks completely healthy. Feels like deferred jobs need their own state and their own alerts rather than being folded into "pending" or "processing".

Anyone handling this differently? Specifically curious whether people distinguish 503 from 429, I lump them together, but 503 is ambiguous in a way 429 isn't.

reddit.com
u/beck_the_tech — 8 days ago
▲ 1 r/node

How should a Node.js health check treat database and queue failures?

For a small Node.js service, a /health endpoint that returns 200 proves the process is listening. It can stay green while the database or queue is unavailable. A deeper check catches that, but it can also create load and turn a dependency issue into a restart loop.

I’m leaning toward separate liveness and readiness endpoints. Liveness checks the process and event loop. Readiness verifies critical dependencies with tight timeouts. Deployment probes use readiness, while alerts use a synthetic request that exercises the full path.

How do you divide these checks in production? Which dependencies belong in readiness, and which should only affect alerts?

reddit.com
u/UkrMalt — 6 days ago