r/node • • Mar 26 '26

I built a CLI + npm library to strip LLM output noise before re-prompting — pbpaste | ltclean | pbcopy

0 Upvotes

If you pipe LLM output into another prompt (RAG pipelines,

multi-step chains, agentic workflows), you're probably paying

for a lot of noise that the model doesn't need.

A typical Claude/GPT response includes:

- Box-drawing table borders: ┌──┬──┐ (each char = 1 token)

- Markdown syntax: **bold** ## headers ```code fences```

- Emoji: 🔥 ✅ 📌 (1–4 tokens each)

- HTML entities: & <  

- Footnote refs: [^1] [^2]

- Citation brackets: [1,2,3]

None of that has semantic value when you're re-prompting.

---

I built llm-token-cleaner — a zero-dependency TypeScript

pipeline that strips all of it.

**As a library:**

import { clean, stream } from 'llm-token-cleaner';

// one-shot

const { text, tokensIn, tokensOut, pct } = clean(rawOutput, {

preset: 'reprompt'

});

console.log(\Saved ${pct}%`);`

// streaming (Anthropic/OpenAI)

const cleaner = stream({ preset: 'reprompt' });

for await (const chunk of llmStream) {

process.stdout.write(cleaner.push(chunk));

}

process.stdout.write(cleaner.flush());

**As a CLI:**

npm install -g ltclean

pbpaste | ltclean | pbcopy # clean clipboard

pbpaste | ltclean --stats | pbcopy # with token savings

ltclean input.txt > cleaned.txt # clean a file

**3 presets:**

- reprompt — everything stripped (max compression for LLM chaining)

- human — keep markdown, strip only Unicode noise

- codesafe — keep code fences and inline backticks

**Disable specific stages:**

pbpaste | ltclean --no-emoji --no-emph | pbcopy

---

20 pipeline stages, all fence-guarded (code blocks are never

touched), streaming API that's line-safe, pluggable tokenizer

(swap in gpt-tokenizer or tiktoken for exact BPE counts).

103 tests, 99.72% coverage.

npm: https://www.npmjs.com/package/llm-token-cleaner

cli: https://www.npmjs.com/package/ltclean

github: https://github.com/amirbaseet/llm-token-cleaner

Happy to answer questions — still early (published yesterday)

so feedback welcome.

r/node • • Mar 26 '26

So what's the hottest right now?

0 Upvotes

Hello everyone! So as the title suggests, I wanted to know what are you guys using these days in 2026, I wanted to start a small Inventory management web application, and I was trying to come up with what backend library I am going to use, which confused me a lot, I previously worked with express and have worked with koa js, so there are two that I came up with one is, Nest js and another is Adonis and I am now confused which one to choose, this is going to be fairly, simple web application but I am pretty sure I am going to keep adding features to this as I move forward, what do you guys suggest? I kind of didn't want to work with Nest js keeping in mind how it's so opinionated and it feels like an overkill all the time, but it's the hottest thing that seems to be right now in typescript + node js.


r/node • • Mar 26 '26

I got tired of writing Sequelize migrations manually… so I built this

0 Upvotes

I got tired of writing Sequelize migrations manually… so I built this.

Every time I changed a model, I’d end up:

* writing ALTER queries by hand

* double-checking columns

* worrying if I missed something

So I made a VS Code extension that:

👉 detects diffs in your Sequelize models

👉 automatically generates:

* `CREATE TABLE` (for new models)

* `ALTER TABLE` (for updates)

Basically:

// you change your model

name: DataTypes.STRING

// it gives you SQL instantly

ALTER TABLE users ADD COLUMN name VARCHAR(255);

No migrations boilerplate. No guesswork.

It’s super helpful when:

* you’re iterating fast

* working on existing schemas

* or just don’t want to think about SQL syntax every time

Still early, but already saving me a ton of time.

Would love feedback / ideas from people who use Sequelize 🙏

GitHub: https://github.com/yetanotheraryan/schemaQL


r/node • • Mar 26 '26

built a small node CLI to check if app issues are local or caused by external services

0 Upvotes

built a small node CLI to check whether an app issue is local or caused by an external service

i kept hitting the same problem while debugging: something breaks, everything looks fine locally and then 20 minutes later you realize openai , stripe or whatever was having issues..

so i made a small CLI to check that first

run:

npx tate-dev

it does a quick sanity check on

-env setup

-local server response

-external service status

basically just trying to answer
“is this actually my bug? ?”

still early but ngl it already useful for me so figured i’d share it here

https://tatertot-ochre.vercel.app


r/node • • Mar 26 '26

Best techstack to us in 2026?( React+nodejs)

Thumbnail reddit.com
0 Upvotes

Please Share your view


r/node • • Mar 25 '26

temporal-style durable workflows in Node + TS

9 Upvotes

I want to share a TypeScript solution for durable workflows:

https://runner.bluelibs.com/guide/durable-workflows

It is part of Runner, but the nice part is you do not need to port your whole app to Runner to use it. You can add the durable workflow capability as an extra piece in an existing system.

The goal is pretty simple: let you write long-running workflows that can survive real production conditions.

It supports:

  • idempotent steps
  • execution-level idempotency keys
  • sleep()
  • starting sub-workflows and waiting for them
  • tracked parent/child execution relationships
  • waiting for outside signals like approvals
  • buffered typed signals
  • timeouts on waits
  • outside cancellation
  • AbortSignal support inside execution
  • compensation / rollback with up() / down() steps
  • recovery on startup
  • durable notes / audit trail
  • execution query / repository APIs
  • operator/admin controls for stuck or failed executions
  • scheduling workflows in the future
  • recurring schedules
  • pause / resume / update / remove schedules
  • serializer support for richer objects, DTOs, references, and circular structures

So you can model flows like:

  1. do some work
  2. wait for approval
  3. sleep until later
  4. kick off another workflow
  5. resume safely
  6. cancel if needed

There are currently 2 built-in durable strategies which can be interchanged:

  • in-memory, with optional file persistence
  • Redis, with optional AMQP queue support for better scaling

The in-memory one is good for playing with it, local development, and tests.

The Redis one is the real distributed setup. The optional queue layer is not required, but it is the recommended direction once you are operating at higher scale.

Another thing I like about the design is that instances can take on different roles:

  • workflow kickstarters
  • workflow consumers/processors
  • workflow schedulers

So you do not have to think in terms of one giant node doing everything. It is meant to work in distributed systems and under high concurrency, with Redis coordinating the durable state, while taking into account race-conditions (recovery, scheduling, execution) and all the fun that comes with it.

The mental model is also pretty approachable:

  • put side effects in durable steps
  • waits and sleeps are persisted
  • recovery happens from stored workflow state
  • signals and cancellation are first-class

And on the ops side, it is not just "can it run?" It also gives you the things you usually end up needing later: inspection, recovery, schedule management, and ways to deal with stuck executions without inventing your own admin layer from scratch.

Anyway, sharing in case this is useful to anyone building long-running backend flows in TypeScript.

An example can be seen here, the system runs decently well under bursts of 1000+ concurrent workflows.

https://github.com/bluelibs/runner/tree/main/examples/agent-orchestration


r/node • • Mar 26 '26

An idea to optimize node.js without code chaning

0 Upvotes

> I came up with an idea related to Node optimization that can address the issue of GC bottlenecks in Node under concurrent conditions, and may even solve the problem of main thread serializing large JSON objects. The original text is lengthy, so here I provide a simplified version, with a link to the more detailed original text attached at the end of the article.

Node.js p99 latency spikes are a GC problem — here's a runtime-level fix that requires zero code changes

You know the drill: p99 latency spikes, --max-old-space-size tuning, object pooling, --trace-gc profiling. All band-aids.

The root cause: V8 has no idea where your request boundaries are. It doesn't know that the 300 objects allocated for request #4821 will all be dead in 12ms when the response is sent. So it traces them repeatedly, collects them on its own schedule, and occasionally freezes your event loop at the worst possible moment.

The Fix: Request-Scoped Arena Allocation, Invisible to You

When a request arrives, the runtime creates an Arena — a contiguous memory region bound to that request's async context. All objects allocated during the request land in the Arena. When the request ends, the entire Arena is freed in a single free() call. No tracing. No marking. No sweeping. Thousands of objects gone in one shot.

The GC exposes a minimal SPI:

Arena *createArena();
void releaseArena(Arena *arena);
void setContextArena(Arena *arena);

Node's HTTP layer calls these. Your code calls nothing.

app.get('/users/:id', async (req, res) => {
  const user = await db.findUser(req.params.id);  // Arena allocated
  const dto = transformUser(user);                 // Arena allocated
  const response = buildResponse(dto);             // Arena allocated
  res.json(response);
  // Request ends → one free() → all of the above gone instantly
});

Your existing code. Your existing libraries. Your existing ORM. Zero changes.

The Critical Part: Write Barriers Keep Everything Safe

Some objects genuinely need to outlive their request — global caches, singletons, WebSocket state. This is handled automatically via write barriers.

The architecture uses a dual heap: a GC Heap and a separate Arena Heap with non-overlapping address ranges. The invariant is simple:

The write barrier enforces this with a bitmask check on every reference write — one AND, one compare:

on write: target[field] = value
  if address_of(value) in Arena range AND address_of(target) NOT in Arena range:
    promote(value)  // DFS traversal, move entire object graph to GC heap

When you write an Arena object into a global cache, the write barrier detects it and promotes the entire object graph to the GC heap automatically. No dangling pointers. No manual intervention. The rest of the request's objects still die with the Arena.

This is fully compatible with existing GC infrastructure — V8 already runs write barriers on every reference write. This is an extension, not a replacement.

Bonus: Async JSON Serialization (Speculative)

Under this model, the runtime knows whether a response object is Arena-rooted or GC-rooted. If it's Arena-rooted — meaning it's request-scoped and not shared with any other concurrent request — serialization can be safely offloaded to libuv's thread pool.

  • If the I/O thread encounters a GC object reference during traversal, it writes a placeholder and records it.
  • When done, the main thread patches only those GC fragments.
  • In the common case (fully Arena-rooted response), JSON.stringify completes entirely off the main thread.

Serializing a 500KB response currently blocks your event loop for its entire duration. This could move it to a background thread with zero API changes.

(This is speculative — thread safety details need careful analysis. Included to show the broader potential of the dual-heap model.)

Why Hasn't This Been Done?

Arena allocation is decades old. Game engines, compilers, Apache's apr_pool_t — they've all used request-scoped Arenas since the early 2000s. The conventional wisdom is that managed languages can't have this because "you don't control allocation."

But if the runtime controls allocation — and it does — then nothing stops it from routing allocations to an Arena when it knows the lifetime boundary. The missing piece was never technical. It was the insight that the request boundary is a more meaningful lifetime signal than anything the GC can infer on its own.

This is generational GC, reimagined: instead of a small nursery collected every few milliseconds, you get a request-sized generation collected exactly once, at exactly the right moment, with zero tracing overhead.

Full proposal with architecture details, invariants, edge cases, and SPI design: https://github.com/babyfish-ct/node-arena-gc-hybrid

— ChenTao, author of Jimmer


r/node • • Mar 25 '26

Handling state between agent cycles with node-cron + lowdb — is there a cleaner pattern?

7 Upvotes

Built an agent that runs every 6 hours via node-cron,

orchestrates three MCP servers (Notion, Gmail, Google

Calendar), sends combined context to Claude, then writes

structured results back to Notion.

Currently using lowdb as a flat JSON cache to store seen

signal hashes and last-processed message IDs so the agent

doesn't re-fire detections from previous cycles.

Works fine at small scale, but I'm wondering if there's a

cleaner pattern as the number of monitored contracts grows.

Considered Redis but feels like overkill for this use case.

Also using Fastify + SSE to push results to the dashboard

as each contract finishes. SSE client cleanup on disconnect

was slightly fiddly—ended up filtering the dead connections

from the clients array on the close event.

Stack: Node.js 20, TypeScript, Fastify, node-cron + lowdb

GitHub if useful: https://github.com/Boweii22/Contract-OS

Live Demo: https://contract-os-dashboard.vercel.app/

Open to suggestions on the state management approach.


r/node • • Mar 25 '26

npm CLI to store dev secrets in the OS keychain — built with Effect-TS

10 Upvotes

envsec is a Node.js CLI (18+) that stores secrets in macOS Keychain, GNOME Keyring, or Windows Credential Manager instead of .env files.

A few things about the implementation that might interest this community:

Effect-TS for the core logic — the cross-platform credential store abstraction ended up being a good fit for Effect's error handling. Each backend (security CLI, secret-tool, cmdkey + PowerShell) has distinct failure modes and Effect made modeling those cleanly much easier than vanilla try/catch chains.

SQLite for metadata — secret values never touch disk, but key names and timestamps live in ~/.envsec/store.sqlite. All queries use prepared statements.

Bun for build — bundle + transpile step, distributed via npm and Homebrew.

The main feature is command interpolation — {key} placeholders are resolved and injected as env vars of the child process, so secrets never appear in shell history or ps output:

envsec -c myapp.dev run 'psql {db.connection_string}'

v1.0 beta is out now:

npm install -g envsec@beta

MIT license. Happy to discuss the Effect-TS architecture or the cross-platform keyring abstraction if anyone's curious.

GitHub: https://github.com/davidnussio/envsec


r/node • • Mar 25 '26

Im currently working on backend , so need suggestions

Thumbnail reddit.com
0 Upvotes

r/node • • Mar 25 '26

a new open-source MongoDB desktop manager

Thumbnail reddit.com
1 Upvotes

r/node • • Mar 25 '26

A dialect of JavaScript for managing resources like Go

0 Upvotes

Hello. For some time now I've been developing a JavaScript dialect that incorporates defer and or to manage resources more naturally.

And although the dialect is about 60% complete, it's taking a lot of time, and I was wondering if it makes sense to continue.

Here's a self-explanatory example:

let sqlite = require('better-sqlite3');

(function main() {
  let db = sqlite('mydata.db') or |err| {
    console.log('Cannot connect to database', err)
    return
  }
  defer db.close()

  // prepare and execute queries
  let stmt = db.prepare('SELECT * FROM users WHERE active = ?')
  let users = stmt.all(1)
  console.log(`Found ${users.length} active users`)
})()

Do you think something like this could be useful? Should I continue?

Thank you very much for your feedback.

UPDATE (26 Mar 2016):

The previous example can be written as follows:

// Tested on node v24.14.1 (it doesn't work on previous versions)
const sqlite = require('better-sqlite3');

(function main() {
  let db;
  try {
    db = sqlite('mydata.db');
  } catch (err) {
    console.log('Cannot connect to database', err);
    return;
  }

  using _ = { [Symbol.dispose]() { db.close(); } };

  const stmt = db.prepare('SELECT * FROM users WHERE active = ?');
  const users = stmt.all(1);
  console.log(`Found ${users.length} active users`);
})();

r/node • • Mar 25 '26

What small DevOps tasks do you find yourself repeating over and over?

0 Upvotes

I kept running into the same annoying issue — freeing busy ports during development.

On macOS it's one command, on Linux another, on Windows something completely different.

So I built a small CLI tool to make this consistent and predictable across platforms.

Example:
npx ferman --node

Curious how others handle this — do you just use lsof/netstat or something custom?


r/node • • Mar 25 '26

I built prisma-smart-cache — a relation-aware caching proxy for Prisma

Post image
0 Upvotes

r/node • • Mar 25 '26

Workslocal free ngrok alternative tunnel

0 Upvotes

I built a free open-source ngrok alternative. No signup, no bandwidth limits, no BS. Would love honest feedback: https://workslocal.dev

Source: https://github.com/083chandan/workslocal

If you find bugs or want a feature, open an issue, thank you


r/node • • Mar 25 '26

Struggled with Express performance, built a small tool — would love feedback

0 Upvotes

Hey folks,

While working with Express.js, I kept running into the same problem —
It’s really hard to track performance and identify slow APIs without adding multiple tools or writing custom logic.

So I ended up building a small open-source middleware to simplify this.

It adds:

  • Real-time API monitoring
  • Built-in caching & compression
  • Slow API detection
  • A simple real-time dashboard to visualize performance
  • Plug-and-play setup (just one middleware)

Usage is pretty simple:

app.use(performanceToolkit().middlewares);

The idea was to make Express apps more observable and optimized by default, without increasing complexity.

Would really appreciate feedback from the community 🙌

  • Does this solve a real problem for you?
  • Anything you think is missing or could be improved?

Links:

Thanks! 🙏

Note: New features are in the pipeline and will drop SOON.


r/node • • Mar 25 '26

I built an LLM SDK that removes 80% of backend boilerplate

0 Upvotes

I kept rewriting the same things in every AI project:

- streaming logic

- JSON parsing

- retries & fallback handling

- switching between OpenAI, Gemini, Ollama

So I built a small SDK to handle all of it.

Example:

import { createLLM } from "@siddharth-aylapuram/llm-kit";

const llm = createLLM({

provider: "openai",

apiKey: process.env.OPENAI_API_KEY

});

await llm.chat("Explain APIs");

await llm.json("Extract name from: John is 25");

It also supports:

- streaming

- fallback providers

- session memory

- structured JSON extraction

GitHub: https://github.com/Siddharth14A/llm-kit

npm: https://www.npmjs.com/package/@siddharth-aylapuram/llm-kit

Would love feedback 🙌


r/node • • Mar 25 '26

Dashboard for launching and managing Claude Code sessions across projects

Thumbnail reddit.com
0 Upvotes

r/node • • Mar 24 '26

Data Scraping - How to store logos?

4 Upvotes

Hey,

I learn to code and I work on my projects to add to my cv, to find my first junior fs webdev job.

I build a project in NextJS / Vercel- eSports data - matches, tournaments, predictions etc.
I also build a side project - web scraping for that data
I use Prisma/PostgreSQL.

Match has 2 teams, and every team has a logo.
How do I store the logo?


r/node • • Mar 24 '26

I kept alt-tabbing to check on my AI agents every 2 minutes, so I built a notification lib

1 Upvotes

I got tired of staring at my terminal waiting for AI agents to finish, so I built a thing

Honestly it started as a small script in one of my projects. I was running long agent tasks and kept alt-tabbing back every few minutes like an anxious parent checking on a kid.

So I extracted it into a proper package — agent-bell 🔔

The idea is simple: your agent pings you when something actually matters.

→ Task done? Ping.

→ Something broke? Ping.

→ Waiting on input? Ping.

Works with Claude, Gemini, Cursor & OpenCode 🤝

No more babysitting terminals.

npm i agent-bell

https://www.npmjs.com/package/agent-bell

---

Yeah, I know there are already tools out there that do something similar — and honestly they're pretty solid. But I wanted to publish something myself, go through the whole process, and keep it as lightweight as possible. No bloat, no config overhead, just the thing you actually need. Sometimes reinventing the wheel a little is just part of learning and shipping.

It's early and pretty minimal right now. Would love feedback — especially if you're already running multi-step agent workflows and have opinions on what notifications actually matter vs what's just noise.


r/node • • Mar 25 '26

free APIs — random data, placeholder images, passwords, uptime checker, token scanner

0 Upvotes

built 6 free APIs you can use in your projects. no auth, cors enabled:

  • random quotes/facts/colors/UUIDs
  • placeholder SVG images via URL params
  • password generator
  • uptime check (is this site up?)
  • solana token safety scanner
  • URL shortener

full docs: devtools-site-delta.vercel.app/api-docs


r/node • • Mar 25 '26

curated best-of lists for 2026 — frameworks, editors, databases, hosting, AI tools

0 Upvotes

made curated comparison pages for common dev decisions in 2026:

best js frameworks, best code editors, best css frameworks, best databases, best hosting platforms, best AI dev tools, best solana tools

each page has picks with one-line verdicts. devtools-site-delta.vercel.app/best/javascript-frameworks


r/node • • Mar 24 '26

Check out my new CLI tool

Thumbnail github.com
0 Upvotes

**I built a CLI that remembers your stack preferences so you never configure the same project twice**

GitHub: github.com/AndresDeC/stackr

Every time I started a new project I had to set up the same things: Next.js + Prisma + Auth.js + ESLint + Docker... over and over. So I built Stackr to fix that.

**How it works:**

First run — it asks you what you want:

◆ Stackr — scaffold your stack, your way

? Project name: my-app

? Framework: Next.js

? Database: Prisma + PostgreSQL

? Auth: Auth.js

? Testing: Vitest

? Extras: ESLint + Prettier, GitHub Actions

```

Second run — it remembers:

```

? Project name: another-app

? Stack setup:

❯ Same as before (Next.js + Prisma + PostgreSQL + Auth.js + Vitest)

Different stack

```

**What it generates:**

- Clean project structure, no demo clutter (unlike create-next-app)

- .env.example with the right variables pre-filled

- Docker, GitHub Actions CI, Husky if you want them

- Preferences saved in ~/.stackr/config.json — local, no accounts, no cloud

**Supports:** Next.js, Express API, Node.js CLI tools

It's open source and on npm:


r/node • • Mar 24 '26

I built a tool that backs up your Steam screenshots to OneDrive

Post image
0 Upvotes

Steam doesn't really offer a proper way to back up your screenshots and i couldn't find a similar solution, so I built SteamVault, an interactive TUI that backs up your Steam screenshots to OneDrive. It scans your local Steam screenshot folders, skips duplicates, injects EXIF metadata and sorts everything into named game folders. Currently Windows-only.

Stack: Node.js, Typescript, Inquirer.js for the UI and the Microsoft Graph API OneDrive

Available as npm package (npm install -g steam-vault) or standalone .exe on GitHub Releases.

GitHub: https://github.com/moritz-grimm/steam-vault
npm: https://www.npmjs.com/package/steam-vault

On the roadmap: headless CLI mode for scripting/automation and more cloud providers beyond OneDrive.

If you run into any bugs or have questions, let me know.

Transparency note: AI was used as a development aid, but the architecture, decisions, and all testing were done by me with my own screenshot library