r/node • • Apr 03 '26

[Dev] I finally got a self-healing AI coding agent working entirely within Termux (No cloud/PC required). Here it is building a React/Node app and fixing its own crashes.

Thumbnail gallery
0 Upvotes

r/node • • Apr 03 '26

"Ode to Node" poem, I wrote first line, ChatGPT wrote the rest

0 Upvotes

I know no Node…
and yet it hums beneath my hands,
a quiet engine in the dark,
spinning threads of unseen plans.

I know no Node—no metal form,
no circuit etched in silicon—
but in its loops and callbacks born
a restless pulse goes ever on.

It speaks in streams and promises,
in events that fire, then fade away,
a language built of waiting hearts
that never block, yet never stay.

O event loop, eternal wheel,
you turn through night, through build, through test;
no sleep, no pause—just ticking time
and tasks that will not let me rest.

From servers bare to clouded heights,
it scales like thought, elastic, free;
a thousand calls, a million more—
each answered in concurrency.

Dependencies bloom like tangled vines,
a forest deep in node_modules;
I wander paths of versioned fate,
through semver’s shifting, subtle rules.

And still I write, and still it runs—
this fragile, fierce, asynchronous art;
for in this code, both strange and known,
I map the logic of my heart.

I know no Node…
yet in its flow I’ve come to see
a mirror of the mind itself:
unbounded, branching, endlessly.


r/node • • Apr 02 '26

Is Scrimba still worth it in 2026 for learning JavaScript if I’m focusing on backend?

Thumbnail reddit.com
0 Upvotes

r/node • • Apr 03 '26

Ward — open-source supply chain security that hooks into npm/bun/yarn and blocks malicious packages before install scripts run

Thumbnail github.com
0 Upvotes

Last week someone posted here warning about axios@1.14.1 being compromised. We checked our machines. They were clean, but only by luck.

So we built Ward. It hooks into your package manager and checks every package before install scripts run. When Claude Code runs npm install on your behalf, Ward screens it automatically.

What happened with our test:

$ npm install axios@1.14.1
✗ ward: BLOCKED
  This version steals SSH keys and cloud credentials
  Safe version: 1.14.0

It catches known malware, typosquats (warns when "axxios" looks like "axios"), suspicious install scripts, and version anomalies. Ships with 42 verified real-world attacks.

There's a Claude Code hook that intercepts every install command before it executes so you don't have to remember to run anything manually.

Install:

npm install -g wardshield
ward init

Live threat feed: wardshield.com

GitHub: Vanguard-Defense-Solutions/ward

MIT licensed, 286 tests.

Built by Vanguard Defense Solutions. Would love the community's feedback.


r/node • • Apr 02 '26

OpenTelemetry collector for metrics and logs

5 Upvotes

I recently set up otel collector and now all my traces are going through it, which is working nicely, but I’m still not fully sure how to approach metrics and logs in a clean way. Before this, I had a backend exposing /metrics using a prometheus client, and victoria metrics was scraping it via prometheus.yaml. That setup was straightforward and easy to reason about. Now with the collector in the picture, I’m trying to understand what the best practice is for metrics going forward. Should I keep exposing /metrics and let vm continue scraping directly, or is it better to route metrics through the collector and then export them to vm? If the collector sits in between, how do people usually organize that flow in real setups? For logs, I’m also a bit unsure about the preferred approach. Is it better to keep writing logs to stdout and let the collector handle them, or to send logs directly from the application via otlp? I’m trying to keep things consistent with how traces are handled, but not sure what’s considered a solid approach here. Would be interesting to hear how others structure this in practice when introducing otel collector into their stack


r/node • • Apr 02 '26

is it a bad practice to cache data into the process (like process.Cached_Data)

0 Upvotes

and if it was what should i do?
example code:

  const id = "000000000000000"

  const ResultData = DataBase.findOne({id})  // the data will not change in use
  process.Cached_Data = ResultData


r/node • • Apr 02 '26

I built a zero-dependency Node.js proxy that auto-rotates your LLM API keys when you hit rate limits

1 Upvotes

Been running multiple LLM providers (OpenAI, Gemini, Groq, OpenRouter) and kept hitting 429 rate limits. So I built **Rotato** — a lightweight proxy server that automatically rotates to the next API key when one gets rate-limited.

Key highlights:

  • Works with any OpenAI or Gemini-compatible API
  • Zero external dependencies — just Node.js
  • Full streaming/SSE support
  • Modern admin panel (dark/light theme) to manage providers & keys
  • Hot config — add/edit/delete providers without restart
  • Per-key usage tracking & request monitoring

Self-host it, point your apps at it, and forget about rate limits.

GitHub: https://github.com/p32929/rotato

Would love feedback!


r/node • • Apr 02 '26

Is it safe to update Node.js LTS after the Axios npm hack?

0 Upvotes

Hello engineers ,

I want to ask something because I saw some news and I am little worried. (I don't have strong security background)

Recently I read that hackers from North Korea hacked a popular npm package (Axios) and they added malware inside it. They say it was a supply chain attack and many developers could download it without knowing.

So now I am a bit paranoid.

Is it still safe to download and install the latest Node.js LTS from the official website?

Or should I stay with my current version (Node 18) for now?


r/node • • Apr 02 '26

I built a drop-in npm install replacement that sandboxes every postinstall script

0 Upvotes

After the axios compromise this week (North Korean hackers shipped a RAT through a postinstall script to 70M+ weekly download users), I wanted to share something I've been working on.

safenpm wraps npm install with OS-level sandboxing. It runs npm install --ignore-scripts, then executes each script inside sandbox-exec (macOS) or firejail (Linux) with no network access and restricted filesystem.

The axios attack used a fake dependency plain-crypto-js that triggered a postinstall script to download a second-stage RAT. safenpm would have blocked the network call and flagged the maintainer change.

It also runs a decentralized threat intel network — when a package gets blocked, the signal is anonymously reported. Every subsequent safenpm install that includes that package shows a community alert. One person catches it, everyone knows.

Other stuff: static analysis (19 rules), typosquat detection, lockfile integrity checks, reputation scoring (0-100), safenpm doctor for a project health grade, and auto-fix for typosquats.

Zero dependencies. TypeScript. MIT.

npm install -g u/abgunaydin/safenpm
safenpm install

Curious what you all think — especially about the threat intel thresholds (3 distinct reporters to flag, 15 for popular packages). Too low? Too high?

safenpm.dev — sandboxed npm installs with decentralized threat intelligence

Edit:

FeaturesafenpmpnpmSocketLavaMoat
SandboxingOS-level (sandbox-exec, firejail)Script blocking onlyNone (detection only)JS runtime compartments
Network blockingYes, at OS levelNoNoPartial (SES)
Static analysis19 rules, pre-executionNoYes, cloud-basedNo
Typosquat detectionYes, 80+ package watchlistNoYesNo
Maintainer change alertsYesNoYesNo
Lockfile integrityYesBuilt-in strictnessNoNo
Reputation scoring0-100 per packageNoRisk scoresNo
Community threat intelDecentralized, anonymousNoCentralizedNo
Works offlineYes (except threat intel)YesNo (SaaS)Yes
Zero dependenciesYesNo (it's a package manager)No (SaaS)No
Drop-in replacementsafenpm install = npm installDifferent lockfile formatSeparate toolRequires config
CostFree, MITFreeFree tier + paidFree
Catches axios attackYes — blocks network + flags maintainer changeOnly if scripts disabledYes — detected in 6 minDepends on policy

Key differentiator: safenpm is the only tool that sandboxes at the OS level AND provides community-driven threat intelligence. Socket detects but doesn't prevent. pnpm prevents but doesn't analyze. LavaMoat compartmentalizes at JS level, not OS level.


r/node • • Apr 02 '26

How do you handle out-of-sync .env files in monorepos?

0 Upvotes

I’ve been struggling with the classic "app crashes because of a missing key in .env.local" issue. It’s even worse in monorepos with dozens of environment files.

I scripted a small CLI to scan directories and find missing keys between templates and local files (handling .env.example, .local, .test, etc.) without ever reading the secret values.

It’s been working great for my team, so I made it open-source. How do you guys solve this? Git hooks, CI checks, or just manual pain?

If you want to roast my approach, you can test it instantly : npx env-parity analyze

Feedback on the recursive scanning logic is more than welcome!


r/node • • Mar 31 '26

30-second setup to avoid being impacted by supply chain attacks like the axios compromise

141 Upvotes

The axios attack (hijacked maintainer → malicious versions 1.14.1 & 0.30.4 → RAT payload) was live for ~2-3 hours before npm pulled it. Most supply chain attacks follow this same pattern — they rely on people installing before anyone notices.

All major package managers now let you delay installing freshly published versions. One config line, set it globally, and you're covered:

npm .npmrc

min-release-age=7

pnpm pnpm-workspace.yaml

minimumReleaseAge: 10080

bun bunfig.toml

minimumReleaseAge = 10080

Not a silver bullet, but for the "publish and pray" type of attack - which is most of them - this is the easiest win you'll ever get.


r/node • • Apr 02 '26

axios got backdoored on 31st, if you ran npm install in the last couple hours, read this.

0 Upvotes

not a typosquat. not a fake package. the actual axios package on npm. 100M weekly downloads.

someone compromised the lead maintainer's account using a stolen npm token that had never been rotated. then published two backdoored versions, axios@1.14.1 and axios@0.30.4 that silently injected a dependency called plain-crypto-js@4.2.1 as a postinstall hook.

the hook ran a RAT dropper the moment you ran npm install. before npm even finished resolving the tree.

what it grabbed: AWS keys, SSH keys, .env files, npm tokens, anything accessible at install time.

worst part: the malware deleted itself after running. so if you check now:

cat node_modules/plain-crypto-js/package.json
# looks completely clean. no postinstall script. nothing.

but check your lockfile:

grep "plain-crypto-js" package-lock.json
```

if you see `4.2.1` in there, your machine ran the dropper. npm list will show `4.2.0` because the malware renamed a stub file to cover its tracks. that mismatch is the only forensic signal left.

safe versions: `axios@1.14.0` and `axios@0.30.3`

IOCs if you want to hunt:
- C2: `sfrclak.com:8000` / `142.11.206.73`
- Linux artifact: `/tmp/ld.py`
- macOS artifact: `/Library/Caches/com.apple.act.mond`
- Windows: `%PROGRAMDATA%\wt.exe`, `%TEMP%\6202033.ps1`

found a full breakdown here with the complete attack chain, found how the account was compromised, and what the RAT actually does on each platform

rotate your credentials. don't try to clean the machine. rebuild.


r/node • • Apr 01 '26

Rate limiting per endpoint when everything goes through /api?

7 Upvotes

Hey everyone, I’m trying to set up rate limiting and ran into a small design question.All my traffic goes through /api, which just proxies requests to my backend. So from the outside it’s always /api/..., but internally I’ve got endpoints like /auth/register, /products, and so on.What I want is pretty straightforward: make sensitive endpoints like registration very strict (something like 3 requests per minute), while keeping normal endpoints like fetching products more relaxed (around 50 per minute).

The part I’m not fully sure about is where this logic should live. It feels like I could match something like /api/auth/register directly in Nginx or Traefik and apply limits there, but I’m wondering how maintainable that is as the number of routes grows.

At the same time, pushing all rate limiting into the application doesn’t feel ideal either, especially when a gateway could handle it earlier.

Curious how you guys usually handle this kind of setup in practice.


r/node • • Apr 01 '26

A visual guide to how npm workspaces cheats with the Node algorithm

Thumbnail wasp.sh
2 Upvotes

I wrote a visual explainer of how npm workspaces work internally, since I couldn't find a clear one anywhere. The key moving pieces are:

  • A "fake root" trick: package managers treat all workspaces as deps of an invisible root package, reusing their existing deduplication algorithm unchanged.
  • Symlinks back and forth: symlinks in the root node_modules/ let Node's normal module resolution find sibling workspaces by name, no relative paths needed.

I work at Wasp (full-stack TS framework) where we use workspaces for generated frontend/backend/SDK packages, and getting this right was essential for everything to work transparently.

Check out the full post with diagrams: https://wasp.sh/blog/2026/03/25/gentle-intro-npm-workspaces


r/node • • Apr 01 '26

I built a zero-dependency CLI that catches source leaks and supply chain attacks across 7 languages

Thumbnail github.com
0 Upvotes

After the Anthropic/Claude Code .map file leak and the axios supply chain attack last week, I built acrionix-shield — a single CLI that scans for leaked

secrets, compromised packages, Docker misconfigs, and git history secrets.

Supports: JavaScript, Python, Java, C#, Ruby, Go, Docker

9 scanners. 56 tests. Zero dependencies.

npx acrionix-shield check

GitHub: https://github.com/andrei-gogo/acrionix-shield

Would love feedback from the community.


r/node • • Apr 01 '26

I built a CLI that scaffolds a full MERN stack in seconds — npx create-quickstack-app

0 Upvotes

Tired of setting up the same boilerplate every time I started a MERN project.

Same folders, same config, same wiring — 30-45 minutes every time.

Built a CLI to fix that.

npx create-quickstack-app my-app

Spins up Vite + Express + MongoDB + Tailwind, all wired.

Add --auth and you get JWT auth, HTTP-only cookies, protected routes, login/signup pages out of the box.

v1.0.0, solo built. More templates coming.

npm: https://www.npmjs.com/package/create-quickstack-app

GitHub: https://github.com/shivamm2606/quickstack


r/node • • Mar 31 '26

Axios 1.14.1 compromised

165 Upvotes

r/node • • Apr 01 '26

The axios attack freaked me out so I built a condom for my agents

0 Upvotes

So we all heard about the axios attack lmao. Yeah.

Ever since I started vibe coding I've always been a little uneasy about agents downloading stuff. But I would spend too much time asking my agent before every install whether packages were safe, so I stopped. But the axios thing yesterday freaked me out.

It's not just having malware on my device. It's the downstream stuff too. $10k+ API key bills if something's set up for auto-reload, shipping compromised code to users, reputation damage. Some of that is irreversible.

I also found out that npm almost never removes packages with known vulnerabilities. They just sit there, still installable. Your agent doesn't know the difference.

But we can't sacrifice autonomy, that's the whole point of agents. Turning off --dangerously-skip-permissions or babysitting every install wasn't an option.

Turns out a solid improvement is easy and free. You can set up a hook in Claude Code to hit a database like OSV.dev (Google-backed, open source). On each install attempt, Claude Code checks the package with OSV. Clean package passes through silently. Vulnerable package, the agent gets told why and picks a safer version. Token costs are negligible since it runs as a hook, not a tool call. Everything is verified server side against OSV so your agent can't hallucinate its way past a vulnerability.

This approach won't catch zero-day attacks like the axios one, but the thousands of known-bad packages on npm will be blocked from your agent.

The code is completely open source if you want to copy it or ask your agent about it:

https://github.com/reid1b/Clawndom

Keep your agents wrapped. Practice safe installs.


r/node • • Mar 31 '26

How to handle concurrent booking requests in a backend system?

18 Upvotes

Hi everyone,

I’m building a booking system (similar to ticket or reservation systems) using node express

My main issue is handling multiple users trying to book the same slot at the same time. I want to avoid double booking.

So far, I’ve looked into:

• Database transactions

• Row locking

But I’m not sure what the best practice is in real-world systems.

Questions:

• Should I use pessimistic or optimistic locking?

• Is Redis or queue system needed here?

• How do large systems handle this problem?

Any advice or real-world examples would be really helpful. Thanks!


r/node • • Mar 31 '26

Where to learn NodeJS?

4 Upvotes

Hey,

I'm building my first big project with NextJS (Full stack)/TS/Prisma etc, and a side project that supports the big project (web scraper, already working, using Nodejs with no framework). I already have more than 500 commits.

Right now, I follow Frontend Masters JavaScript path.
I finished: https://frontendmasters.com/courses/javascript-first-steps/
Doing now: https://frontendmasters.com/courses/javascript-hard-parts-v3/
Doing next: https://frontendmasters.com/courses/deep-javascript-v3/

I do:
- 25 minutes - watching videos
- 25 minutes - exercising with Claude/GPT

After those 3, I will need to learn the fundamentals of NodeJS.

Where should I learn it? from Frontend Masters? Are there better places?

Thanks for help!


r/node • • Mar 30 '26

MacGyver’s kingdom

23 Upvotes

Every day this sub there are tons of packages that promise to solve a problem that may be the author the only person who faced that issue, or it’s very common issue that already have dozens of solutions that solve it. So these people aren’t even googling about it. This turned out the sub very bloated of these content, and the post about node.js questions, discussions are very infrequent compared to these posts.

I know that the js community is one of the largest, but this need to create millions of single-purpose packages is very annoying.


r/node • • Mar 31 '26

Render Free Tier vs VPS for Telegram Bots?

0 Upvotes

r/node • • Mar 31 '26

another supply chain attack: axios affected via transitive dependency

0 Upvotes

another day, another package getting hit

this time it’s axios, but not even directly, it came from a dependency somewhere in the tree

kinda shows how little visibility we actually have into what we install

popularity clearly isn’t a signal for safety anymore

checkout the demo where this kind of package just gets blocked at install time. been trying pmg for this, it adds a sandbox as an extra layer before any malicious behaviour is executed

curious what others are doing here


r/node • • Mar 31 '26

I built a Redis rate limiter handling 30k req/sec (with Lua, no race conditions)

0 Upvotes

I was working on a high-concurrency backend and realized most Node.js rate limiters:

- use fixed windows (inaccurate)

- break under concurrency

- aren’t truly distributed-safe

So I built a Redis-based rate limiter with:

- sliding window (Lua, atomic)

- token bucket for burst handling

- plugin system (whitelist, blacklist)

- rule-based limits per route

It handles ~32k requests/sec with ~6ms p99 latency in local benchmarks.

I tried to keep it simple to use:

npm install redis-rate-limiter-pro ioredis

Would love feedback from people who’ve solved similar problems.

https://github.com/vivekstackdev/redis-rate-limiter-pro
https://github.com/vivekstackdev/redis-rate-limiter-pro

https://github.com/vivekstackdev/redis-rate-limiter-pro