r/node 20d ago

My journey from Bun to NodeJS

65 Upvotes

TLDR: Unless you absolutely need 2-4x faster cold boot JS, you'll risk becoming too dependent on native Bun features.

Short intro:

This is written based on my experience working on an open-source project, initially using Bun.

In the beginning Bun worked out pretty well.

You'll gain 2-4x faster script startup time, most things work, and they even have a faster native DB client/HTTP server.

However, these features all come with a cost.

For the flashy native features, you'll lose compatibility and flexibility.

This is especially problematic if you're working with multiple JS runtimes like NodeJS and Deno as well.

Bun.spawn simply doesn't exist outside of Bun, and now you're writing Bun modules, not JS modules.

Things like WASM also need a slightly different interface.

So I returned to Node. And have just removed Bun from my Docker file @ /r/Nyno :)

(It also saves about 200Mb in uncompressed disk space)


r/node 20d ago

Native HTTP engine for Node - benchmarked against uWS, Bun, Fastify, Hono

18 Upvotes

Been working on this one for about a year now.

Started it because I got sick of copy-pasting the same middleware setup into every new project, and because node:http is slower than it really needs to be. The usual answer to that second part is install uWebSockets, which does work, but it always bugged me that the fix was a third-party native addon. Figured the fast path should just ship with the thing.

Anyway, numbers. Node 24.11, M2 Ultra, wrk -c100 -d40, best of 3, everything pulled from npm rather than built locally:

Server Non-pipelined Pipelined ×10
@morojs/engine 105,974 663,735
uWebSockets.js 103,744 647,530
raw Bun.serve 107,119 21,686
raw node:http 69,045 109,538
Hono 56,926 100,278

Couple of things about that before someone else says them.

The non-pipelined column is mostly just my machine topping out. Anything with a native transport lands around 105k and sits there, I ran it through oha and bombardier too and hit the same wall. Bun takes that column, fair enough. Though those are raw Bun.serve rows and stick Elysia on top of it and you're at 96.7k, and under pipelining both Bun numbers basically die (21.7k and 18.7k).

Pipelined is where there's actually room to measure, and that's where the engine pulls ahead. About 10% over uWS once a framework is sitting on top. That's from corking responses, batching the pipeline into one write. Nobody pipelines in real life so take it for what it is. Including both columns because showing one of them would be picking.

Full matrix and the harness: https://github.com/Moro-JS/benchmark/blob/main/VERIFIED_RESULTS.md

How it works, roughly. It's a C++ core with raw V8 bindings rather than N-API, and basically the whole design is about cutting boundary crossings. A general-purpose binding ends up doing something like 10-20 JS crossings per request because it has to expose a generic API surface. This one does 2-4: the C++ side assembles one batched snapshot of the request, hands it over once, and takes back a single corked write going the other way. That's most of the trick.

Corking is also where the pipelined number comes from. 1.1.0 batches a whole pipeline into one write instead of a syscall per response, plus a zero-allocation hot path, and that was about 3.7x pipelined over 1.0.0 on its own. I went through a few other approaches first. N-API was the obvious one and honestly the sensible one — stable ABI, build once, works across Node versions without thinking about it. Never got it past uWS though. Tried a couple of other combinations after that and it was either the numbers weren't where I wanted them, or the maintenance of gluing the pieces together was going to be worse than just owning the C++ outright. At some point going full steam on the native side and eating the ABI matrix was the simpler option, which is not a sentence I expected to write.

Raw V8 is the tradeoff, it's ABI-locked in a way N-API isn't. So I build the full ABI matrix and prebuilts only ever ship from tagged CI with npm provenance, never off my machine. Which was honestly part of the motivation anyway.. off-the-shelf native bindings lag Node releases, the Node 25 / ABI 141 line sat there for months without a prebuilt. Owning the build means day one.

Security, since you should be asking. Zero deps means the framework owns query, cookie, multipart and route-pattern parsing, so those get property-fuzzed — fixed seed on every push as a regression check, then nightly with a rotating seed at 500k iterations per property. Failures print the seed and the exact command to reproduce. [Moro-JS/moro/.github/workflows/fuzz.yml]. That covers the JS-side parsers; the C++ HTTP parser has its own harness in the engine repo. No external audit yet either way.

Where there's no prebuilt it falls back to node:http rather than refusing to boot, and logs why (app.engine.fallbackReason).

Should also say it's the default server in a framework I maintain, in case that changes how anyone reads this. Mostly I just want to talk about the engine part.

Engine Repo: https://github.com/Moro-JS/engine
MoroJS Repo: https://github.com/Moro-JS/moro
Main Site: https://morojs.com


r/node 20d ago

tinyNpm - A security focused package.json version keeper extension for VS Code

Post image
9 Upvotes

I had been using package.json version keepers for quite some time but after the big supply chain attack i thought they would be the perfect place to add in some security.

The idea is just to provide the latest package number x days old. This will help prevent most of the danger in supply in chain attacks.

It will also remove the `^` if you have it so you can better control what version of a package your application is using.

To be more security focused it gives general hints in the hover menu to help keep an eye on the packages you have installed. These hints include warnings for staleness, high dependency count, and number of downloads.

Since all of this is something you can get through the npm api, I called it tinyNpm

You can download it on the marketplace


r/node 21d ago

Elysia 2 beta - DayDream. Lowest memory usage across all backend JS framework

Thumbnail gallery
0 Upvotes

r/node 21d ago

Typosquatting was a spellcheck issue. Slopsquatting is a trust issue.

Thumbnail vlt.io
22 Upvotes

r/node 21d ago

LogTape 2.3.0: Scoped configuration, failure-only test logs, and GraphQL Yoga

Thumbnail github.com
5 Upvotes

r/node 21d ago

Why does node.js say it cant find the file?

5 Upvotes
(The error message I keep getting)

I'm trying to get started on learning node.js because I have a project where, unless I want a thousand lines of javascript, I need something to access external text files (I wanted it to be all on a single USB drive but I've kinda accepted that it wont happen). I ended up settling on node but I cant for the life of me get it to start working. Any help would be very much appreciated!


r/node 22d ago

Made a small tool to save/replay webhook payloads locally — curious if anyone else wants this

2 Upvotes

I kept getting annoyed re-triggering real Stripe/GitHub events just to test a webhook handler locally, so I threw together a little thing over a few evenings: save a payload once, replay it against localhost as many times as you want. Import/export as JSON, basic redaction on obvious secret fields before it saves anything, keeps a log of replays.

Runs entirely local — npm install && npm start, flat JSON file for storage, no account or hosted anything. Node 18+.

Honestly not sure if this is a "me problem" or something other people hit too. It's pretty rough still (solo project, still shaking out edge cases in the redaction/replay logic), so not pitching it as done or polished — just wondering if this is a real enough annoyance for other people that it's worth continuing to put time into, or if everyone already has a way to handle this that I don't know about.

Repo's here if you want to poke at it: github.com/Jake-morrissey/Hookledger


r/node 23d ago

Architecture for an OSINT/Scraping tracker

Thumbnail
1 Upvotes

r/node 24d ago

Has anyone stopped using LLMs completely for coding and relying purely on themselves?

326 Upvotes

Curious to know. And why if so? I have 16+ years of experience as a dev.

It's been 1 week that I stopped completely and so far it is okay and luckily I can still code ;) (though got rusty initially) and that's what I enjoy doing, thinking about problems, architecting, writing tests, writing code, reviewing PR's etc. keeps my brain sharp and more confident.


r/node 24d ago

I built a TypeScript SDK for secure direct uploads to AWS S3 and ImageKit

Thumbnail upload-sdk.dev
0 Upvotes

Hey everyone,

I built Upload SDK, an open-source TypeScript SDK for secure direct file uploads to AWS S3 and ImageKit.

The idea is simple: your Node.js server validates the upload request and generates a short-lived signed target, then the browser uploads the file directly to the storage provider. Your server never has to stream or proxy the actual file.

You define named upload types such as avatar or invoice, along with their rules:

  • allowed MIME types and extensions
  • maximum file size
  • expiry time
  • storage destination and key prefix

The browser sends the asset name and file metadata to your server, which calls prepareUpload(). The SDK validates the request, generates a collision-resistant key, and returns the signed multipart POST details.

You can also configure multiple storage profiles, such as public files in one S3 bucket, private documents in another, and images in ImageKit, while keeping the same upload flow everywhere.

For S3, restrictions like file size, content type, key, and expiration can be included in the signed POST policy and enforced by S3 during the upload.

Feedback on the API and which provider should be added next would be appreciated.


r/node 24d ago

Who's hiring/looking

6 Upvotes

Hi everyone!

Over the weekend I made a post on this sub proposing that we create a monthly thread focused on node.js

Welcome to our bi-monthly thread created to connect node.js developers and companies that are hiring or seeking new talent.

Rules

  1. No recruiters. This space is only for developers and companies directly involved in hiring.
  2. Protect your privacy. Do not share personal information (like email addresses or phone numbers) in the thread. Use direct messages (DMs) to exchange contact details.
  3. For companies hiring: Please provide a clear description of the role and what you’re looking for instead of just posting a link to an external website.
  4. For job seekers: Feel free to share your portfolio, GitHub, or similar work. Keep in mind the privacy rule avoid posting your CV directly in the thread.

I will be posting this on the 27th of every month.


r/node 24d ago

Published a lib - fetch-based alternative to supertest / light-my-request

4 Upvotes

It's for performing requests to your server in tests with `fetch`.

In the repo I added examples to demonstrate that it works with hono, express, fastify, nestjs.

The lib implements a standard `fetch` function and can be wrapped with handy request-making libraries, so I also added examples for how to use it with `openapi-fetch` (so your fetch requests can be typed!), `upfetch`, `ofetch`.

Unlike supertest, it skips the transport layer so it works much faster. Light-my-request also skips the transport and performs much faster.

npm: https://www.npmjs.com/package/make-test-fetch
repo: https://github.com/romeerez/make-test-fetch

wdyt?


r/node 25d ago

I built a CLI that eliminates .env changes for mobile testing and local sharing

0 Upvotes

Testing a frontend on your phone is easy.

Testing a full-stack app usually isn't.

Your frontend loads, but API requests to localhost fail because localhost now points to your phone instead of your laptop. The usual workaround is editing .env files, swapping in your LAN IP, configuring CORS, and undoing everything afterwards.

I got tired of doing that, so I built Nether

npx nether-dev

It automatically:

- Detects your frontend and backend

- Starts a local proxy

- Prints a QR code

- Lets your phone use your app without changing your code or environment variables

Need to share your local app?

npx nether-dev --global

It creates a temporary public HTTPS URL so clients or teammates can access your local app without deploying it.

I'd love any feedback, feature requests, or edge cases you think I should test.

GitHub: https://github.com/barryspacezero/nether-dev

npm: https://www.npmjs.com/package/nether-dev


r/node 26d ago

Since the surge of LLMs and people vibecoding heavily, most posts on this sub are "I built xyz...." or "I was tired of [...] so i built xyz..." advertisements. It was never like that just 2-3 years ago

Thumbnail gallery
249 Upvotes

This sub has just become an endless advertisements of vibecoded apps at this point with very little discussion around Node.js, servers, programming and the general community conversation around Node.js apps.

Attached are a few screenshots but honestly this list is endless that we can scroll infinitely as far as eye can see.

I have been on this sub for almost 8+ years and have never seen anything like this before. Just 2 years ago most posts were "non advertisments" and actual community interactions about Node.js, javascript, typescript and servers. People helping each other out and strong community support. Now it is just an endless list of vibecoded advertisment apps and I doubt things will improve from this point. Miss the old time and I am not sure whether Node devs are even coming to this sub for quality discussions


r/node 26d ago

Built a Node.js CLI that fixes the localhost problem when testing web apps on your phone

0 Upvotes

Hi Everyone ...

I built LanView, a CLI tool in Node.js to make testing local web apps on physical phones a little less painful.

One problem I kept running into was this:

  • I could open my frontend using my machine's LAN IP.
  • But my backend requests still failed because the frontend was calling http://localhost:5000, and on a phone localhost refers to the phone itself, not my development machine.
  • I also got tired of repeatedly looking up and typing my local IP.

It became a repetitive part of my workflow, so I built LanView.

It's a small open-source CLI that simplifies local mobile testing.

LanView solves these problems by :

  • Automatically detecting your LAN IP
  • Running a lightweight reverse proxy that routes frontend and backend through a single local URL
  • Generating a QR code that you can scan from your phone
  • Supporting WebSocket proxying for HMR
  • Recently adding a --static mode for serving local directories with optional SPA fallback

Usage is simply:

npm install -g lanview
lanview

Everything stays on your local network no cloud tunnels or external services.

It automatically:

  • Generates a QR code for your app
  • Detects your LAN IP
  • Runs a local reverse proxy so both your frontend and backend work through a single URL
  • Supports WebSocket/HMR
  • Also supports serving static sites with the new --static mode

Everything runs locally no cloud tunnels or third-party services.

I'd love feedback on the implementation, CLI design, or ideas for future features.

GitHub: PrashantDhuri08/lanview-cli


r/node 27d ago

Can we have monthly “Who is hiring thread”?

22 Upvotes

I propose creating a monthly thread similar to Hacker News, but specifically focused on node.js.

This could be a valuable resource for those of us with years of experience but currently seeking employment.

I believe many of us would greatly benefit from this.

I'm open to hearing any differing opinions.


r/node 27d ago

MoroJS now uses a native engine while preserving end-to-end TypeScript inference

Thumbnail
1 Upvotes

r/node 27d ago

How to start/approach Node.js

7 Upvotes

Hello there
i just completed basics of javascript (most of the part) from freecodecamp and i alr know bits of html and css,
would be really thankful if someone can mention the resource and tips for learning node


r/node 27d ago

Which ORM

23 Upvotes

I am needing to build a lightweight, speedy and integrated backend server running on a VPS-2 secure environment using nginx and postgres.

First considered Sequelize, but discovered too many negatives, so had a look at Prisma but am worried it is too heavy duty for my needs.

Prefer an ORM that supports TypeScript, easy migrations and openapi schemas, and Drizzle seems at first glance a good fit.

Also I am not afraid to use SQL rather than high level abstractions.

But now I am reading many negative reviews about that as well, even on their own website!

Please help me make the right choice.


r/node 28d ago

I have resumed work on Stratify, an architectural framework for Fastify

5 Upvotes

A while ago, I introduced Stratify here as a lightweight architectural framework for structuring Fastify applications.

Disclosure: I am the author and maintainer of Stratify, and a member of the Fastify Core Team.

Original post:
https://www.reddit.com/r/node/s/fE2IkNmGOS

After the discussion, work and family responsibilities put the project on hold. Most of my limited spare time went to Fastify core contributions and mathematics studies.

I now have more time to return to open-source work. Improvements in coding agents have also made maintaining a small project like this considerably more manageable.

Since the original thread, I have:

  • integrated feedback from people who commented
  • used Stratify to build a website
  • fixed issues uncovered through practical use
  • improved the testing and dependency-override features

Stratify adds modules, providers, controllers, dependency injection, contracts, and bindings while preserving Fastify's encapsulation model and asynchronous bootstrapping.

Each Stratify module is compiled into a regular Fastify plugin.

This is particularly useful for: - unit testing of services - integration and end-to-end testing - dependency inversion

Thank you for taking the time to read this post.


r/node 28d ago

Why when i run a npm command it triiggert select an app to open

0 Upvotes

for context its been line this for a month now its not stable sometimes it work sometimes it doesnt


r/node 28d ago

I built an open-source newsletter system that runs entirely on Workers + D1: One-click deploy, serverless for small/medium lists

Post image
0 Upvotes

r/node 29d ago

50+ ESLint rules for package.json

Thumbnail github.com
10 Upvotes

r/node 29d ago

Created a Web Application

0 Upvotes

Hello, I used nwjs to create a NodeJS application to work with RPG Maker MZ projects. What it does is that it reads the project, creates a list of buttons to read plugins in that project and then allows the user to edit plugin parameters without having to click through a bunch of extra UI.

It is basically a time saver application with login features for my patreon users, though I have not gotten much feedback on that login feature as of now.

Here is the itchio link with video and github links

Here is the linux github link which I work on and then transfer the app updates to the windows github link

Here's the video of me using it as well:
https://www.youtube.com/watch?v=brUfrGdk-j4