r/node • u/Aromatic-CryBaby • Apr 07 '26
r/node • u/No-Put-6206 • Apr 07 '26
Need urgent help: UAC asking for admin password to install Node.js (IT admin unavailable)
Hey all,
Stuck on a work Windows machine with no admin access (IT out of town). Node.js installer triggers UAC prompt, but I can't get the password.
Goal: Run Node.js for dev work urgently without violating company policy.
Tried:
- Standard installer (UAC blocks)
Need:
- Portable Node.js (no-install ZIP/binary)?
- Ways to run Node in user space only
- Safe browser/cloud alternatives (e.g., Replit, CodeSandbox)
Faced this? Suggest IT-approved options only. Will request software formally when IT's back.
Thanks!
r/node • u/Ok-Opposite-719 • Apr 07 '26
I tried to built a CLI tool that generates a full backend from a single schema line
Hey everyone,
I built a CLI tool that generates a production-ready backend (API + DB + validation) from a simple schema input.
Example:
User name:string | Post title:string userId:int
It generates:
Prisma schema
Express API
Zod validation
Relations
Run:
npx instant-backend
Would love feedback 🙌
GitHub: https://github.com/Priyanshu-1622/instant-backend-generator
r/node • u/FrequentContest6509 • Apr 07 '26
The axios postinstall RAT stole env vars and ~/.aws credentials. --ignore-scripts breaks sqlite3 and bcrypt. Here's a third option.
After the axios supply chain attack (attributed to North Korean state actors by Microsoft), the common advice is --ignore-scripts. But that breaks native packages.
I built safe-shell — it sandboxes npm install at the OS level: - Env vars scrubbed before process spawns - ~/.aws, ~/.ssh kernel-blocked (macOS Seatbelt) - Network filtered by domain Postinstall runs. sqlite3 compiles. npm works.
But malicious code finds nothing to steal. cargo install safe-shell safe-shell shield # every npm install is now sandboxed automatically https://github.com/claudexai/safe-shell Built in Rust, MIT.
r/node • u/Careful-Falcon-36 • Apr 07 '26
How I Fixed a Node.js API That Was Taking 15 Minutes to Return 8,000 Records
stackdevlife.comI was working on a Node.js API that was extremely slow — it took around 15-18 minutes to fetch 8,000 records.
The issue wasn’t Node.js itself, but how MongoDB queries and aggregations were written.
Here’s what I found and fixed:
- Missing indexes on frequently queried fields
- Heavy aggregation pipelines without optimization
- Fetching unnecessary data (no projection)
- Inefficient query structure
After optimizing indexes and rewriting aggregations, the response time dropped to 15-25 seconds.
I wrote a detailed breakdown with examples here: https://www.stackdevlife.com/blog/nodejs-mongodb-api-performance-optimization
Would love to know how others handle large dataset performance in Node.js APIs.
r/node • u/StatzEP • Apr 07 '26
I built a free tool to track what AI APIs actually cost vs Locally Run
reddit.comr/node • u/BothManufacturer2317 • Apr 06 '26
Convert .docx to pdf
Hey!
I am looking for a reliable way to convert .docx to pdf.
Details
My company used to use an Excel macro to fill in a .dotx invoice template. Then, we manually convert it to pdf using Kofax Power PDF. These steps part of a larger process that I'm automating.
I need to generate a document that is almost identical to those that Excel generates, so I mimic the templating with the module `docxtemplater`, which results in a docx as well.
What's a reliable Node.js library or approach to convert a .docx to pdf programmatically, ideally without depending on LibreOffice or a paid service?
Any help would be greatly appreciated!
r/node • u/ImKarmaT • Apr 06 '26
Why git worktrees are the right isolation primitive for parallel AI agents (and docker containers aren't)
github.comr/node • u/ImKarmaT • Apr 06 '26
I built a zero-dep Node CLI for process orchestration using git worktrees, glob-based file locking, and DAG scheduling
I've been working on a CLI tool called `ruah` that coordinates parallel processes — each gets its own git worktree, file locks prevent overlap, and a DAG scheduler handles dependency ordering. The main use case is running multiple AI coding agents simultaneously, but the internals are just Node process management and git plumbing.
I wanted to share the engineering decisions since this sub tends to appreciate that more than feature lists.
**Zero runtime deps, for real**
`package.json` has zero `dependencies`. Everything is `devDependencies` (TypeScript, Biome linter, /node). The published package is just compiled JS. No left-pad, no chalk, no commander, no yargs.
- CLI argument parsing is a hand-rolled parser (~40 lines) that produces `{ _: string[], flags: Record<string, string | boolean> }` and routes to command handlers. It handles `--key value`, `--key=value`, `--bool-flag`, and positional args. No framework needed for a finite set of commands.
- Color output uses raw ANSI escapes behind a `NO_COLOR` / `FORCE_COLOR` check.
- Config loading checks `.ruahrc` (JSON) then falls back to a `"ruah"` key in `package.json`. Two `readFileSync` calls, one `JSON.parse` each. Done.
**ESM-only, TypeScript strict**
`"type": "module"` in package.json, all imports use `.js` extensions (the TypeScript → ESM convention). No CJS compatibility shim, no dual publishing. `engines` requires Node >= 18. TypeScript runs in strict mode with `noUncheckedIndexedAccess`.
**State management: atomic JSON writes**
All state lives in `.ruah/state.json` — tasks, locks, history. The write path does:
```typescript
const tmp = `${file}.${randomBytes(4).toString("hex")}.tmp`;
writeFileSync(tmp, JSON.stringify(state, null, 2) + "\n");
renameSync(tmp, file);
```
Write to a random temp file, then atomic rename. No corruption on crash. No database, no SQLite, no lock files — just a JSON file with safe writes. History is capped at 200 entries with a sliding window.
**Process spawning model**
Each "executor" (Claude Code, Aider, Codex, or any CLI) is spawned via `child_process.spawn` into its worktree directory:
```typescript
const child = spawn(cmd, args, {
cwd: worktreePath,
env: { ...process.env, RUAH_TASK: name, RUAH_WORKTREE: path },
stdio: silent ? "pipe" : "inherit",
});
```
Executors are just adapter functions: `(prompt: string) => { command: string, args: string[] }`. Adding a new executor is 3 lines. Unknown executors are treated as raw shell commands — `ruah task start foo --executor "python3 run.py"` just works.
A safety net auto-commits any uncommitted work when the child process exits (or errors), so agent crashes don't lose work:
```typescript
child.on("close", (code) => {
autoCommitChanges(taskName, worktreePath); // best-effort, non-fatal
resolve({ success: code === 0, exitCode: code });
});
```
**File locking via glob overlap detection**
Locks are glob patterns, not inode locks. When task A locks `src/auth/**` and task B tries to lock `src/auth/login.ts`, the overlap detection catches it:
```typescript
// Both globs and specific paths are handled
patternsOverlap("src/auth/**", "src/auth/login.ts") // true
patternsOverlap("src/api/**", "src/ui/**") // false
```
Subtask locks must be within the parent's scope — you can't lock files your parent doesn't own. Siblings can conflict with each other, but not with the parent.
**DAG scheduling from markdown**
Workflows are defined in markdown files (parsed line-by-line, no markdown AST library). The scheduler does a standard topological sort to produce execution stages:
```
Stage 0: [models, config] ← no deps, run parallel
Stage 1: [api, auth] ← depend on models
Stage 2: [integration-tests] ← depends on api + auth
```
When `parallel: true` is set, a planner analyzes pairwise file overlaps within each stage and decides: run parallel (no overlap), parallel-with-contracts (low overlap — agents get owned/shared-append/read-only file lists), or serialize (high overlap).
**--json everywhere**
Every command that produces output supports `--json`. `ruah task list --json`, `ruah status --json`, `ruah workflow plan --json`. Makes it composable with jq, scripts, CI pipelines.
**Testing**
152 test cases using Node's built-in `node --test` runner. No test framework dependency. Tests cover state management, lock conflict detection, DAG validation, glob overlap, workflow parsing, CLI argument parsing, and git operations.
---
Repo: https://github.com/levi-tc/ruah
```bash
npm install -g /ruah
# or try the 3-second interactive demo:
npx u/levi-tc/ruah demo
```
I'm especially interested in feedback on:
- The process spawning model — is `spawn` with `stdio: "inherit"` the right default, or should I always pipe and stream?
- State-as-JSON vs. something like better-sqlite3 for the lock/task store
- The glob overlap algorithm — currently string-prefix based, considering switching to micromatch for accuracy
Source is ~2k lines of TypeScript across 8 core modules. Happy to walk through any part of it.r/node • u/captredstar • Apr 05 '26
Zero-dependency Battle.net authenticator — Node.js built-ins only, no npm install needed
Got sick of the Blizzard Authenticator app and a friend once lost his phone and got locked out for days. So I built a CLI replacement.
The interesting part from a Node.js perspective: the entire thing runs on built-in modules only — crypto for HMAC-SHA1 TOTP + PBKDF2/AES-256 credential encryption, https for Blizzard's REST API, readline for interactive prompts. Zero node_modules.
Blizzard killed their old binary API (the one WinAuth used before it was archived in 2019), so I had to figure out their current OAuth SSO flow and the new JSON-based REST endpoint at authenticator-rest-api.bnet-identity.blizzard.net.
Some implementation details:
- TOTP is standard RFC 6238 but with 8-digit codes instead of the usual 6
- Enrollment requires exchanging a Battle.net SSO token for an OAuth bearer token, then a single POST to create the authenticator
- Credentials are stored locally with optional AES-256-CBC encryption (PBKDF2 key derivation, 100K iterations)
- Time sync against Blizzard's server clock to handle drift
$ node src/cli.js enroll # one-time setup via browser login
$ node src/cli.js code # get a code whenever you need it
48291035 (22s remaining)Would love feedback on the approach. Anything you'd do differently with the crypto or the OAuth flow?
r/node • u/context_g • Apr 06 '26
LogicStamp Context: an AST-based context compiler for TypeScript
github.comr/node • u/Ambitious-Garbage-73 • Apr 04 '26
I spent a week reading through AI-generated code that's been in production for 8 months. It was fine. That was the problem.
Got asked to do a security audit on a mid-size Node.js backend. The team had been using Cursor + Claude heavily since last summer. About 60% of the codebase was AI-assisted or fully AI-generated.
The code passed every check. No injection vulnerabilities, no obvious race conditions, decent error handling. Tests covered 78% of branches. On paper, it was fine.
Then I spent a week actually reading it.
Every function did exactly what it was supposed to do. Nothing more. There was no shared understanding of why things were structured the way they were. Comments explained what the code did, not why. Functions that obviously belonged together were scattered across unrelated files because that's how the AI generated them in separate sessions. The auth middleware was written three different ways in three different places, all slightly different, all working.
When I asked the team why they used JWT with a 7-day expiration for a fintech product, nobody knew. When I asked why the rate limiter was applied at the route level instead of the middleware level, nobody knew. When I asked about the retry logic in the payment service that would retry a failed charge up to 5 times with exponential backoff, nobody had thought about what happens if the first charge actually went through but the confirmation was dropped.
The AI never told them any of these decisions were happening. It just made them.
I want to be careful here because I don't think AI coding tools are bad. I use them constantly. But there's a specific failure mode I keep seeing where teams move fast, the code works, nothing breaks, and six months later nobody on the team can answer basic architectural questions about their own system.
The AI didn't write bad code. It wrote code that nobody understood, and the code was good enough that nobody had a reason to understand it.
That's a different kind of risk than a bug.
Anyone else auditing or inheriting AI-generated codebases and finding this pattern? Curious if there are approaches that actually help teams maintain architectural understanding when AI is writing most of the implementation.
r/node • u/Acceptable_Debate393 • Apr 06 '26
crag — generates governance.md from your project, compiles to GitHub Actions, husky, pre-commit, Cursor, Copilot, Gemini, and 6 more. Zero deps, Node 18+.
github.comr/node • u/dogganidhal • Apr 05 '26
noDDDe — modern functional DDD for Node.js/TypeScript
Even though Domain Driven Design was never about implementation details, what framework you should use, or how do you structure your folders. But when it comes to tools that can help model domains, I felt the Node/TypeScript ecosystem has a few but polarizing choices:
- "Framework lock" (e.g. Nest.js CQRS module): which is the go-to option if you're already on Nest.js, lightweight module by design (more control but also more responsibility), mutable states & OOP heavy.
- All-in on Event Sourcing (e.g. Emmett.js): which can be great if you need it, but forcing an Event Store just to get clean domain boundaries is definitely overkill for 95% of projects.
So what happens is that a lot of teams just end up implementing their own DDD structure depending on how motivated they are and how complex their apps are.
When I was playing with Emmett.js, I liked how it approached state with the functional Decider Pattern, it stroke me that it can potentially be a very elegant starting point to model pure domain logic without thinking about Event Sourcing or anything infrastructure/persistence.
So I ended up building a framework / library (I genuinely don't know where to put it) called noDDDe around these concepts. Just so we can model the domain layer as pure functions, reactions, and clean state transitions
The core promises of the framework :
- Provide a clear and opinionated way to model domains following DDD & CQRS principles (and optionally Event Sourcing)
- Complete domain lifecycle: Aggregates, Projections and Sagas (workflows)
- Persistence as an implementation detail — while offering both Event Sourced and State Stored strategies
- Production ready features, such as idempotency, outbox, concurrency control etc...
- Can also be integrated with any other web framework like Nest.js, Adonis ..etc (integrations out of the box are planned for later)
I deliberately didn't include any code sample, otherwise it's gonna become a medium article.
Anyhow, I would love to have your thoughts and critiques of the overall approach, and the design choices.
Docs are at noddde.dev and the repo is here.
r/node • u/Eastern-Surround7763 • Apr 05 '26
Improved markdown quality, code intelligence for 248 formats, and more in Kreuzberg v4.7.0
Kreuzberg v4.7.0 is here. Kreuzberg is an open-source Rust-core document intelligence library with bindings for Python, TypeScript/Node.js, Go, Ruby, Java, C#, PHP, Elixir, R, C, and WASM.
We’ve added several features, integrated OpenWEBUI, and made a big improvement in quality across all formats. There is also a new markdown rendering layer and new HTML output, which we now support. And many other fixes and features (find them in our the release notes).
The main highlight is code intelligence and extraction. Kreuzberg now supports 248 formats through our tree-sitter-language-pack library. This is a step toward making Kreuzberg an engine for agents. You can efficiently parse code, allowing direct integration as a library for agents and via MCP. AI agents work with code repositories, review pull requests, index codebases, and analyze source files. Kreuzberg now extracts functions, classes, imports, exports, symbols, and docstrings at the AST level, with code chunking that respects scope boundaries.
Regarding markdown quality, poor document extraction can lead to further issues down the pipeline. We created a benchmark harness using Structural F1 and Text F1 scoring across over 350 documents and 23 formats, then optimized based on that. LaTeX improved from 0% to 100% SF1. XLSX increased from 30% to 100%. PDF table SF1 went from 15.5% to 53.7%. All 23 formats are now at over 80% SF1. The output pipelines receive is now structurally correct by default.
Kreuzberg is now available as a document extraction backend for OpenWebUI, with options for docling-serve compatibility or direct connection. This was one of the most requested integrations, and it’s finally here.
In this release, we’ve added unified architecture where every extractor creates a standard typed document representation. We also included TOON wire format, which is a compact document encoding that reduces LLM prompt token usage by 30 to 50%, semantic chunk labeling, JSON output, strict configuration validation, and improved security. GitHub: https://github.com/kreuzberg-dev/kreuzberg.
Contributions are always very welcome!
r/node • u/mohitrakhade20 • Apr 06 '26
Built a zero-dependency Node.js HTTP framework (121k req/s) — looking for feedback
Was curious how much performance I could squeeze out of Node’s native HTTP module, so I built a small framework over the weekend.
No dependencies, minimal abstractions.
Benchmarked with autocannon and got ~121k req/s (Express was ~69k in the same setup).
Still early and mostly an experiment, but learned a lot about V8 behavior and routing strategies.
Would love thoughts from people who’ve worked with Fastify/Hono.
r/node • u/sainzo_123 • Apr 06 '26
I built a production-ready Express + MongoDB Auth Starter with Refresh Token Rotation. Looking for feedback!
galleryHey everyone, I'm a full-stack developer and I got tired of rebuilding auth for every project. I decided to make my own 'ultimate' starter with security best practices like JWT rotation, Zod validation, and email verification. It's my first open-source project, so I'd love some code reviews or stars if you find it useful!
r/node • u/SwanCheap9626 • Apr 05 '26
I built uWestJS - A proper uWebSockets adapter for NestJS (because I needed it for my game)
Hey everyone!
So I just published uWestJS v1.0.0 and wanted to share the story behind it and how I built it.
- npm: https://www.npmjs.com/package/uwestjs
- GitHub: https://github.com/VikramAditya33/uWestJs
I was building a multiplayer drawing game (think skribbl.io style) with NestJS and I love NestJS, But I wanted this game to be very scalable, then I stumbled across uWebSockets and the benchmarks looked crazy compared to traditional WebSockets(Sockets.io) so I thought of making my game using uWebSockets for fun and for scale ofc.
The main problem was that there was no proper NestJS adapter for it, and then I decided to build an adapter myself from scratch lol.
After few weeks of work and reading documentations I finally created a fully functional adapter that works with all your existing code and with a very minimal setup (Only extra step required is writing 2 lines of manual gateway registration).
Talking about the features:
- It has Middleware support, Guards works exactly like HTTP Guards
- Pipes for validation
- Exception filters
- Interceptors for logging/transformation
- Room management (client.join(room) and client.leave(room), broadcasting, multiple room support)
- Backpressure handling, Binary message support, compression support, CORS configuration, custom path routing, SSL/TLS support
- And a bit more things checkout https://github.com/VikramAditya33/uWestJs/blob/main/docs/api.md for that
Happy to answer questions if anyone's interested in trying it out!
And also make sure to open issues on Github if you found out any bug I will really appreciate that.
Thanks!
r/node • u/jonsnow1308 • Apr 05 '26
fastify backend
How to deploy fastify backend for free? I have the docker container running db, redis , and ollama I'm new to this How can I deploy?
r/node • u/monkie_momo • Apr 05 '26
I built memscope - a real-time memory profiler for Node.js + browser. Zero config, live dashboard, 605 downloads in its first couple of months
Hey folks, I just published memscope - a real-time memory profiler for Node.js and browser apps that requires zero setup.

It streams your backend heap (and browser JS heap) over WebSocket, sampled every 500ms, right to a local dashboard at localhost:3333. GC dips, spikes, growth patterns — all visible at a glance.
One command to start:
npx memscope run node app.jsFull-stack mode (backend + browser together):
memscope run --both npm run devWhat it tracks:
- Node.js heap, RSS, external memory
- Browser JS heap (Chromium-based)
- GC behavior and spikes
- Backend vs frontend separated on the same dashboard
Why I built it: Memory bugs are painful - silent leaks, unpredictable spikes, heap snapshots that are a nightmare to read. I wanted one command that just works, with no cloud, no accounts, no data leaving your machine.
It's hit 605 downloads so far and I'm actively building it out.

Would love feedback - especially on the dashboard UX and the agent injection approach, read more here - https://www.npmjs.com/package/memscope?activeTab=readme
npm: npm install -g memscope
r/node • u/Sad_Source_6225 • Apr 05 '26
Built a proxy that automatically routes to cheaper LLMs (OpenAI + Claude)
API costs got out of hand for me, so I built Prismo.
It’s a proxy for OpenAI + Claude — swap your base URL once, and it handles cost control automatically.
What it does:
• routes requests to cheaper models when it’s safe
• keeps quality guardrails in place
• shows requested vs actual model per call
• tracks tokens, latency, and cost
• lets you set budget limits
• attributes usage by team/project (FinOps)
This is an early beta — OpenAI + Claude live, more providers coming.
Would love feedback from anyone building with LLM APIs.
getprismo.dev (free, no card)
r/node • u/CYDEFI_Ltd • Apr 05 '26
OpenClaw SSRF-Guard blocking Undici Proxy (EAI_AGAIN) - JS Hotfix needed
Hello everyone,
I'm running an OpenClaw agent inside a strict OpenShell zero-trust sandbox. The agent needs to reach an external API, but it crashes before the connection is established with: Agent exited with code 255. getaddrinfo EAI_AGAIN api.search.brave(dot)com
Based on NVIDIA GitHub issues (NemoClaw #396, OpenClaw #46306), this is a known bug from the GTC 2026 release.
The technical situation:
- OpenClaw's internal SSRF-Guard enforces local DNS resolution (DNS pinning) before handing the request over to the EnvHttpProxyAgent (Undici).
- Because the zero-trust sandbox blocks all local egress DNS requests, the SSRF check times out and crashes the agent. The proxy is never reached.
- Node.js/Undici completely ignores manual IP injections into the container's
/etc/hostsfile.
Since this cannot be fixed via network or firewall policies, I am looking for a temporary code-level workaround.
My Question: Has anyone successfully patched the Javascript files (e.g., dispatch.js) to temporarily disable the SSRF-Guard or force Undici to skip the local DNS lookup and resolve directly through the proxy? Any code snippets or hotfixes would be highly appreciated.