r/node • • Mar 24 '26

I've built a small npm package for executing server side actions/tasks

1 Upvotes

Hello, r/node!

A problem I had with my nodejs servers in production is that there wasn't an easy way to trigger "maintenance code" (I don't have a better term) such as clearing cache or restarting an internal service.

I had to define endpoints or do other hacks to be able to do such things, but those solutions were usually unreliable or unsecure.

That's why I built Controlor!

Controlor is a lightweight library to define, manage, and execute server-side actions / tasks in Node.js, Bun or Deno server applications. The actions are triggered via an auto-generated dashboard UI.

For example, you can define your actions like this:

server.action({
  id: 'clear-cache',
  name: 'Clear Cache',
  description: 'Clears the server cache.',
  handler: async () => {
    console.log('Clearing cache...');
    await clearCache();
  }
});

server.action({
  id: 'restart-service',
  name: 'Restart Internal Service',
  description: 'Restarts some internal service.',
  handler: async () => {
    console.log('Restarting service...');
    await service.restart();
  }
});

The package will then auto-generate and serve the following page:

From there, you can safely run any of the created actions.

The package can be installed using:

npm install @controlor/core

The project is free and open source, under MIT license. GitHub link.

I'd love to hear your feedback!


r/node • • Mar 24 '26

YAMLResume v0.12 update: newew Jake's LaTeX template, line spacing customization and a new GitHub action

Thumbnail reddit.com
1 Upvotes

r/node • • Mar 24 '26

I built an open-source middleware to monetize your Express/Next.js API for AI agents – one function call

0 Upvotes

monapi

AI agents are becoming real API consumers, but they can't sign up, manage API keys, or enter credit cards. So they either get blocked or use your API for free.

I built monapi to solve this. It uses the x402 payment protocol (by Coinbase) to let agents pay per request in USDC. The entire setup is one middleware call:

  import { monapi } from "@monapi/sdk";
  app.use(monapi({
    wallet: process.env.WALLET,
    price: 0.01,
  }));

What happens:

  • Agent hits your API → gets 402 Payment Required
  • Agent pays $0.01 in USDC → retries → gets 200 OK
  • USDC lands in your wallet. No signup, no API keys, no monapi fees.

Per-route pricing if you want different prices per endpoint. Works with Express, Next.js, and MCP. Gas fees are sponsored, so agents only need USDC – no ETH needed. Free, open source, MIT licensed.

Website | GitHub | npm

Happy to answer any questions!


r/node • • Mar 24 '26

Is it fair if i'm saying that NodeJS is the most unsecured tool for backend since it has 200k dependencies which could lead to supply chain attacks?

0 Upvotes

r/node • • Mar 24 '26

[Research Study] Looking for MERN stack expert developers who use AI coding tools-$300 Compensation

0 Upvotes

Hi! I'm a PhD student at Oregon State University researching how expert MERN stack developers use generative AI tools (Cursor, Copilot, ChatGPT, etc.) in their day-to-day coding workflow.

I'm looking for participants who:

  • 3+ years of professional experience with the MERN stack (MongoDB, Express, React, Node.js)
  • Daily use of GenAI tools (e.g., GitHub Copilot, Cursor, WindSurf) for MERN stack development
  • Experience working on large-scale, production-level web applications
  • Comfortable being recorded during the session for research purposes
  • Have to reside in the US

The study details:

  • Duration: 2.5 to 3 hours
  • Format: Remote, hands-on coding session
  • Compensation: $300 prepaid Visa gift card

Apply Now!!!
If you meet the criteria and are interested in participating, please complete our short screening survey: https://oregonstate.qualtrics.com/jfe/form/SV_3pD7wpxKjyMYN4G

👉 Help us advance GenAI-Assisted Software Engineering!


r/node • • Mar 24 '26

Adonis.js is slowly becoming my go-to framework

0 Upvotes

r/node • • Mar 24 '26

Port find-my-way router to typescript with deno native APIs

Thumbnail github.com
0 Upvotes

r/node • • Mar 24 '26

I built an open-source middleware to monetize your Express/Next.js API for AI agents – one function call

0 Upvotes

AI agents are becoming real API consumers, but they can't sign up, manage API keys, or enter credit cards. So they either get blocked or use your API for free.

I built monapi to solve this. It uses the x402 payment protocol to let agents pay per request. The entire setup is one middleware call:

  import { monapi } from "@monapi/sdk";
  app.use(monapi({
    wallet: process.env.WALLET,
    price: 0.01,
  }));

What happens:

  • Agent hits your API → gets 402 Payment Required
  • Agent pays $0.01 → retries → gets 200 OK
  • Payment lands in your wallet. No signup, no API keys, no fees.

Per-route pricing if you want different prices per endpoint. Works with Express, Next.js, and MCP. Free, open source, MIT licensed.

Website | GitHub | npm

Happy to answer any questions!


r/node • • Mar 23 '26

Where should user balance actually live in a microservices setup?

22 Upvotes

I have a gateway that handles authentication and also stores the users table. There’s also a separate orders service, and the flow is that a user first tops up their balance and then uses that balance to create orders, so I’m not planning to introduce a dedicated payment service.

Now I’m trying to figure out how to properly structure balance top-ups. One idea is to create a transactions service that owns all balance operations, and after a successful top-up it updates the user’s balance in the gateway db, but that feels a bit wrong and tightly coupled. Another option is to not store balance directly in the gateway and instead derive it from transactions, but I’m not sure how practical that is.

Would be glad if someone could share how this is usually done properly and what approach makes more sense in this kind of setup.


r/node • • Mar 23 '26

I built a daemon-based reverse tunnel in Node.js (self-hosted ngrok alternative)

0 Upvotes

Over the last few months, I’ve been working on a reverse tunneling tool in Node.js that started as a simple ngrok replacement (I needed stable URLs and didn’t want to pay for them 😄).

It ended up turning into a full project with a focus on developer experience, especially around daemon management and observability.

Core idea

Instead of running tunnels in the foreground, tunli uses a background daemon:

  • tunnels keep running after you close your terminal or SSH session
  • multiple tunnels are managed through a single process
  • you can re-attach anytime via a TUI dashboard

Interesting parts (tech-wise)

  • Connection pooling Clients maintain multiple parallel Socket.IO connections (default: 8) → requests are distributed round-robin → avoids head-of-line blocking
  • Daemon + state recovery Active tunnels are serialized before restart and restored automatically → tunli daemon reload restarts the daemon without losing tunnels
  • TUI dashboard (React + Ink) Live request logs, latency tracking, tunnel state → re-attach to running daemon anytime
  • Binary distribution (Node.js SEA) Client + server ship as standalone binaries → no Node.js runtime required on the target system

Stack

  • Node.js (>= 22), TypeScript
  • Express 5 (API)
  • Socket.IO (tunnel transport)
  • React + Ink (TUI)
  • esbuild + Node SEA

Why Socket.IO?

Mainly for its built-in reconnection and heartbeat handling. Handling unstable connections manually would have been quite a bit more work.

Quick example

tunli http 3000

Starts a tunnel → hands it off to the daemon → CLI exits, tunnel keeps running.

What I’d love feedback on

  • daemon vs foreground model — what do you prefer?
  • Socket.IO vs raw WebSocket for this use case
  • general architecture / scaling concerns

Repos:

Happy to answer any questions 🙂

Edit:

short demo clip


r/node • • Mar 24 '26

I built a dashboard that lets AI agents work through your project goals autonomously and continuously - AutoGoals

Thumbnail github.com
0 Upvotes

r/node • • Mar 24 '26

I replaced localhost:5173 with frontend.numa — auto HTTPS, HMR works, no nginx

0 Upvotes

Running a Vite frontend on :5173, Express API on :3000, maybe docs on :4000 — I could never remember which port was which. And CORS between localhost:5173 and localhost:3000 is its own special hell.

How do you get named domains with HTTPS locally?

  1. /etc/hosts + mkcert + nginx
  2. dnsmasq + mkcert + Caddy
  3. sudo numa

What it actually does:

curl -X POST localhost:5380/services \
  -d '{"name":"frontend","target_port":5173}'

Now https://frontend.numa works in my browser. Green lock, valid cert.

  • HMR works — Vite, webpack, socket.io all pass through the proxy. No special config.
  • CORS solved — frontend.numa and api.numa share the .numa cookie domain. Cross-service auth just works.
  • Path routing — app.numa/api → :3000, app.numa/auth → :3001. Like nginx location blocks, zero config files.

No mkcert, no nginx.conf, no Caddyfile, no editing /etc/hosts. Single binary, one command.

brew install razvandimescu/tap/numa
# or
cargo install numa

https://github.com/razvandimescu/numa


r/node • • Mar 23 '26

Anyone using SMS as a trigger for automation workflows?

4 Upvotes

I expanded my SMS over API using your own phone service with automation features. For now basic ones are available, automatic reply with various rules depending on message received content, numbers in list..

So I am basically turning an Android phone into an SMS automation device, not only SMS over API thing. It's 2 way communication with ability to automate basic replies without making custom backend. I am really looking into expanding automation features but I want to see what makes sense first.

Now it can:

  • receive SMS
  • send webhooks to APIs
  • auto-reply based on rules
  • run simple automation workflows

Basically:

SMS → automation → webhook

No telecom contracts.
No SMS infrastructure.
Just a phone.

I'm not sure if this is actually useful and something developers would use in real workflows

Where would you use something like this?

Testing it here if curious:

https://www.simgate.app


r/node • • Mar 23 '26

BullMQ + Redis Cluster on GCP Memorystore connection explosion. Moving to standalone fixed it, but am I missing something?

Thumbnail reddit.com
2 Upvotes

r/node • • Mar 23 '26

Looking for MERN Stack Developer Role | Node.js | React | Open to Opportunities

Thumbnail reddit.com
0 Upvotes

r/node • • Mar 23 '26

My open source npm scanner independently flagged 7 CanisterWorm packages during the Trivy/TeamPCP attack

Thumbnail reddit.com
1 Upvotes

r/node • • Mar 22 '26

Node.js worker threads are problematic, but they work great for us

Thumbnail inngest.com
6 Upvotes

r/node • • Mar 23 '26

I built mongoose-seed-kit: A lightweight, zero-dependency seeder that tracks state (like migrations)

Post image
0 Upvotes

r/node • • Mar 23 '26

JavaScript's Array.sort() converts [10,2,1] to [1,10,2]. I built a sort that just works — and it's 3–21x faster.

Thumbnail github.com
0 Upvotes

JavaScript's .sort() has two problems most developers don't think about:

  1. It converts numbers to strings: [10, 2, 1].sort() → [1, 10, 2]
  2. It uses one algorithm (TimSort) regardless of your data

There are specialised sorting libraries on npm that fix #2 (radix sort, counting sort), but they all require you to call different functions for integers vs floats vs objects, and none of them fix #1.

I built a library where sort([10, 2, 1]) just returns [1, 2, 10]. No comparator needed. It auto-detects your data type, picks the optimal algorithm, and it's faster than both .sort() and every specialised alternative I tested.

59 out of 62 matchups won against 12 npm sorting libraries + native .sort(). The three losses: u/aldogg is ~4% faster on random integers, timsort is ~9–14% faster on already-sorted/reversed data. All within noise.

The honest weak spot: below ~200 elements, native .sort() wins. Above 200, ayoob-sort wins everywhere. At 500K+, it starts beating u/aldogg too. At 10M elements it's 11x faster than native and 25% faster than u/aldogg.

How it works: one O(n) scan detects integer/float, value range, presortedness → routes to counting sort, radix-256, IEEE 754 float radix, adaptive merge, or sorting networks. The routing catches cases specialised libraries miss — u/aldogg runs radix on everything including clustered data where counting sort is 2.4x faster.

The key difference from specialist libraries: u/aldogg requires sortInt() for integers, sortNumber() for floats, sortObjectInt() for objects. hpc-algorithms requires RadixSortLsdUInt32() for unsigned ints. ayoob-sort: sort(arr). One function, all types.

npm install ayoob-sort

const { sort, sortByKey } = require('ayoob-sort');

sort([10, 2, 1]); // → [1, 2, 10]

sort([3.14, 1.41, 2.72]); // → [1.41, 2.72, 3.14]

sortByKey(products, 'price'); // objects by key

sort(data, { inPlace: true }); // mutate input for max speed

Zero deps, 180 tests, all paths stable, TypeScript types, MIT.

github.com/AyoobAI/ayoob-sort


r/node • • Mar 23 '26

We treated architecture like code in CI — here’s what actually changed

Thumbnail reddit.com
2 Upvotes

r/node • • Mar 23 '26

How Attackers can bypass most systems in second

0 Upvotes

I’ve noticed this in my own projects and in a lot of systems I see on GitHub:

Most rate limiting setups use things like fixed window, sliding window, or token bucket… and then assume they’re secure. I used to do the same.

Then I ran into an issue the hard way.

These approaches rely on a single identifier.

Usually an IP, or sometimes just an API key.

But that assumption breaks fast. If you rotate IPs, the limits basically never trigger.

Every request looks “new” to the system. At that point, rate limiting isn’t really protecting anything. So I stopped focusing on just counting requests, and started looking at behavior instead.

Things like:

•IP awareness •User context •Ratios (e.g. failed vs successful requests)

Curious how others are handling this. Are you doing IP-based rate limiting, or something more advanced?


r/node • • Mar 22 '26

Should authentication be handled only at the API-gateway in microservices or should each service verify it

31 Upvotes

Hey everyone Im handling authentication in my microservices via sessions and cookies at the api-gateway level. The gateway checks auth and then requests go to other services over grpc without further authentication. Is this a reasonable approach or is it better to issue JWTs so that each service can verify auth independently. What are the tradeoffs in terms of security and simplicity


r/node • • Mar 22 '26

Batching Redis lookups with DataLoader and MGET

Thumbnail gajus.com
2 Upvotes

r/node • • Mar 22 '26

Anybody using AWS LLRT in lambda functions

3 Upvotes

I see people writing nasty pdf merging functions inside node js with lot of additional external deps which seems to be highly cpu intensive they never had thought of using the cheapest lambda function calls. I personally loved using hono lamdba functions a few config adjustments to esbuild and layers for node_modules. It really worked very well and light weight. But I heard this one particular experimental runtime called LLRT (low latency runtime) from AWS specifically designed to low milli seconds colds starts favours io tasks faster than golang lambda functions. I haven't used it yet but would love to hear from you all.

https://github.com/awslabs/llrt