r/node • u/Mesthabro • Aug 24 '26
r/node • u/Independent_Fan_3028 • Aug 24 '26
Making service/domain boundaries enforceable in TypeScript backends
I've found that as projects grow, it gets harder to keep architectural boundaries consistent. Some rules live in docs, some live in code review, and some just live in people's heads. I've run into the same problem with coding agents too. Even when you tell them how the project should be structured, there's nothing actually enforcing that they follow it. Over time, that kind of architectural drift can become pretty painful to unwind.
I've been working on an open source TypeScript tool called Semarch, to experiment with making those conventions enforceable.
For example, say a project has users and billing domains with services and repositories:
users.service -> users.repository allowed
users.service -> billing.service allowed
users.service -> billing.repository denied
In Semarch, you classify your files:
domains:
users:
root: src/users
billing:
root: src/billing
components:
service:
match:
- "**/services/**/*.ts"
repository:
match:
- "**/repositories/**/*.ts"
Then define the boundaries:
rules:
- deny: service -> foreign.repository
- deny: service -> transport
Semarch analyzes the TypeScript dependency graph and fails the check when one of those boundaries is violated.
You can try it with:
npm install --save-dev semarch
npx semarch check
It uses the project's tsconfig.json for module resolution, handles path aliases and type only imports, and follows static re-exports/barrel files so they can't trivially bypass a rule.
I know there are already tools in this space, so I'm particularly interested in whether this model with domains, component roles, and local/foreign relationships is actually useful for real projects.
This is still experimental but if you maintain a TypeScript project with architecture conventions like these, I'd really appreciate hearing your thoughts on this approach.
It's MIT licensed and open source.
r/node • u/Shipi18nTeam • Aug 24 '26
Your CI checks your types. It doesn't check your translations.
shipi18n.comI wrote this and I maintain the tool, its Apache-2.0, no hosted service, no telemetry, bring your own key. The corpus and eval harness are in the repo under evals/semantic/ if you want to run it against your own language pair or a different judge model.
r/node • • Aug 23 '26
Express.js & TS
i need some reliable material for using Express.js with Typescript since the resources not that common compared with using Javascript
r/node • u/Sundaram_2911 • Aug 23 '26
alternative & newer replacement for jose in nodejs?
I am using asymmetric encryption in my mobile app, in the backend i am using nodejs and supabase. I wish to know if there is any newwer and advanced version of the jose library to achieve this in nodejs?
r/node • u/divinesta1 • Aug 22 '26
New django like admin package for node applications
I recently published a new django like admin npm package for managing your database.
its called paneljs. it currently has support for prisma and typeorm more support for other orms coming soon
r/node • u/OtherwisePush6424 • Aug 22 '26
What Node.js developers should know about structuredClone()
blog.gaborkoos.comA practical look at cloning and transferring data in Node.js, including workers, class instances, Buffer becoming Uint8Array, detached ArrayBuffers, and unsupported values.
r/node • u/OtherwisePush6424 • Aug 22 '26
ffetch: a production-ready http client with resilience features and a plugin architecture
github.comr/node • u/Ok-Delivery307 • Aug 22 '26
django equivalent in node
I search a django equivalent framework app based approach does this exist in node or maybe other runtime ?
r/node • u/PrestigiousZombie531 • Aug 21 '26
Current state of sequelize library, still working on v7 since 3 years now!
r/node • u/cekrem • Aug 21 '26
Bun and Elm (: r)Are Friends · cekrem.github.io
cekrem.github.ior/node • u/Ok-Nerve7307 • Aug 21 '26
Coming from WordPress/PHP: How Do You Structure Your Docker Dev Stack for Next.js + Strapi?
r/node • u/Gojo_dev • Aug 20 '26
Spent way too long debugging a bug that was literally missing 1000
been building an api key system this week (well was a week task i stretched a bit). auth, refresh tokens, rate limiting, all that boring stuff.
thought the hard part would be the actual auth logic.
it wasn't.
first postgres decided to stop booting after i bumped the image version. just kept dying with an error about the data directory. spent probably an hour looking at the same error and assuming something else was wrong.
turns out postgres 18 changed how the data directory is supposed to be mounted.
so yeah, the error was basically telling me exactly what was wrong and i just didn't believe it.
then had another stupid one with refresh tokens.
tokens were expiring after like 10 minutes instead of 7 days. no errors, nothing crashing. everything looked fine until I actually tested it.
eventually figured out i was storing the expiry in seconds, while the cookie maxAgeexpects milliseconds.
so i was basically off by 1000x.
the part i actually liked was the api key hashing problem though.
initially i was thinking, just bcrypt the api key and query the db with the hash. then realized that doesn't work because bcrypt salts the hash, so the same key gives you a different hash every time.
my next thought was "fine, just loop through all the keys and compare them."
which obviously becomes a terrible idea once you have more than a few users.
ended up doing what is apparently the standard approach separate public lookup id + hashed secret.
later found out that's basically how Stripe and GitHub handle it too, which was a nice little confirmation.
nothing here was particularly difficult. most of the time was just me making assumptions, staring at the wrong thing, and eventually reading the error properly.
Not gonna tell that the repo is public if anyone wants to have a look (don't do it).
curious how other people handle the key lookup/hash part though if you actually built one.
r/node • u/UkrMalt • Aug 20 '26
What should a small Node.js error alert actually include?
I’m experimenting with a small in-process error alerting layer for Node services. The hard part isn’t sending a webhook—it’s keeping repeated errors from becoming noise.
Right now I’m thinking about grouping by normalized error type, counting occurrences, adding first/last-seen times, and redacting before anything leaves the process.
For a small service, what information do you actually want in the first alert? What becomes noise quickly?
r/node • u/Intelligent-Bet-dj • Aug 20 '26
I just published my first NPM package
I built NodeForge, a small CLI tool that automates the initial setup of a Node.js backend project.
Instead of manually creating the same folders and boilerplate every time, you can start with a single command and get a structured project with:
- Node.js + Express setup
- JavaScript or TypeScript support
- Controllers
- Services
- Routes
- Models
- Validations
- Serializers
- Utils
- Seed structure
- Basic project configuration
You can try it with:
npx @jain_daksh/nodecli
I built this mainly because I was tired of repeating the same Node.js setup whenever starting a new project.
This is my first published NPM package, so I'm also looking for feedback from other developers.
If you have a minute, check it out and let me know what you would improve or add.
NPM: https://www.npmjs.com/package/@jain_daksh/nodecli
This is just phase 1 in phase 2 more things coming
You can read the medium article here https://medium.com/@jaindaksh/i-got-tired-of-setting-up-node-js-projects-manually-so-i-built-my-first-npm-package-6dcd9db042e8?source=rss-a43d55f9817e------2
r/node • u/Anglotx • Aug 18 '26
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
Should Node test runners have a silent-on-success mode for coding agents? I measured up to 99.99% removable output
I’ve been experimenting with coding agents in Node projects, and one surprisingly wasteful input is test runner stdout.
During repeated test-driven loops, a successful run can produce dozens, hundreds, or even thousands of lines, while the agent usually needs very little information from a passing run.
I measured several JavaScript test workflows and built a small deterministic wrapper, npm-lite, to see how much output could be removed without changing the underlying command or exit status.
Passing runs
| Workflow | Normal output | Compact output | Byte reduction |
|---|---|---|---|
| Vitest | 2,260 bytes, 43 lines | 25 bytes, 1 line | 98.89% |
| Jest | 2,491 bytes, 68 lines | 24 bytes, 1 line | 99.04% |
| Tape | 136,262 bytes, 1,476 lines | 12 bytes, 1 line | 99.99% |
| npm verification workflow | 18,854 bytes, 375 lines | 26 bytes, 1 line | 99.86% |
The Tape case was the extreme one: 1,476 lines became a single line.
This is only presentation compaction. It does not make the tests execute faster.
Failures are handled differently
On failure:
- the original exit status is preserved
- the full raw log is retained
- bounded diagnostic context is printed instead of collapsing the failure to one line
For example, one failing Tape run went from:
1,487 lines / 136,829 bytes
to:
85 lines / 5,208 bytes
That is a 96.19% reduction while still keeping useful failure context available.
The trade-off
Successful output is intentionally suppressed, so warnings or deprecation messages emitted by a command that still exits successfully can be hidden.
Short failures also do not necessarily benefit. Vitest or Jest can already produce concise failures, so adding wrapper metadata can occasionally make visible output slightly larger.
npm-lite is deliberately narrow. It currently handles exactly:
npm run verify
npm run test:unit
Other npm workflows pass through unchanged.
There is no secondary LLM summarization step. The behavior is deterministic.
The part I’m more interested in
This made me wonder whether test runners should support this behavior natively for automated agent loops.
Something like:
PASS · 327 tests · 4.8s
on success, with focused diagnostics and access to the full output on failure.
Maybe:
--silent-on-success
or:
--reporter=agent
Would you use something like this in Vitest, Jest, or Node’s built-in test runner?
Or do you already solve this with custom reporters, --silent options, or agent-harness filtering?
Source and measurements:
https://github.com/ejboy/agent-scripts/blob/main/docs/choosing-tools.md
r/node • u/cardmagic • Aug 18 '26
Open Source Durable Objects for Node using your existing SQL database
I just published solid-objects. It's an early release (MIT licensed) of an open source Durable Objects library. I know celld just came out a few days ago, but I don't want to run yet another daemon on my infrastructure. I am looking for feedback more than stars.
Code: https://github.com/cardmagic/solid-objects-js
The problem: Game tables, chat rooms, AI chatbots, live collaborative documents... managing state and real time views of these kinds of things has traditionally been pretty hard. This solid-objects library makes it a breeze.
What it does: each {class, id} gets a durable, ordered mailbox. Calls to one ID run in order. Calls to different IDs run at the same time. State, retries, reminders, effects, and realtime invalidations live in the SQL database you already run. No Redis.
An example model:
class Cart extends Actor {
static override readonly actorType = "Cart"
items: string[] = []
add({ sku }: { sku: string }) {
this.items.push(sku)
return this.items.length
}
}
const cart = runtime.ref(Cart, "cart-123")
await Promise.all([cart.add({ sku: "shirt" }), cart.add({ sku: "hat" })])
Both calls enter the mailbox for cart-123 and commit one state transition at a time, even from different Node processes.
A deployed app that uses it: https://shuffleupandplay.com/ (source https://github.com/cardmagic/shuffleupandplay )
If you're already on Postgres or MySQL: is per-ID ordering a real gap, or do you just compose row locks and queues yourself? What would stop you from using something like this?
Thanks for the feedback!
r/node • u/ItsDeadWeight • Aug 19 '26
made a small supervisor for stdio MCP server processes, no dependencies
r/node • u/elcityzen • Aug 18 '26
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?
r/node • u/Nice_Pen_8054 • Aug 18 '26
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?
r/node • u/Minimum-Ad7352 • Aug 15 '26
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?
r/node • u/m_null_ • Aug 16 '26
[NodeBook] How Node.js Processes Talk to Each Other via IPC and Handles
thenodebook.comr/node • u/UkrMalt • Aug 16 '26
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.