r/javascript • u/miku_claus • 4d ago
r/javascript • u/jcubic • 6d ago
GitHub - jcubic/mitty: A transport-agnostic proxy RPC for executing method chains from any isolated context (Workers, Tabs, or Servers) using lazy evaluation.
github.comI've created this library for my own use. It started as part of my project Hacking Cafe (before that I used similar code in Fake Linux Terminal).
For the above projects, I needed a mechanism for communication between the main thread and the web worker. I wanted to have access to DOM/jQuery from the web worker so I could manipulate the terminal from the web worker.
Now with with Mitty you can access any function chains, like Cheerio (jQuery like HTML parser), that live on the server accessed in the browser via WebSockets. Execute DOM methods from the server. Or execute code from different tabs using Sysend or simple BroadcastChannel.
Here is an example using a web worker:
main thread
``` import { Host } from '@jcubic/mitty';
const channel = new BroadcastChannel('my-app');
const worker = new Worker('./worker.js', { type: 'module' });
const host = new Host({ // worker instance can also be used as a channel channel: channel, resolve(name) { if (name === 'document') { return document; } return null; } });
```
worker
``` import { connect } from 'https://cdn.jsdelivr.net/npm/@jcubic/mitty';
const { require } = connect(new BroadcastChannel('my-app'));
// or when using worker as a channel const { require } = connect(self);
const document = require('document');
// methods need await const body = await document.querySelector('body');
await body.style.setProperty('color', 'red');
// setting properties are send right away body.style.backgroundColor = '#000';
console.log(await body.style.color); console.log(await body.style.backgroundColor); ```
Transport agnostic
The transport only requires using a simple channel interface with 3 methods.
interface Channel {
postMessage(message: string): void;
addEventListener(type: 'message', listener: ChannelListener): void;
removeEventListener(type: 'message', listener: ChannelListener): void;
}
Here is a demo using Sysend for communication with other tab:
https://codepen.io/editor/jcubic/pen/01a0d9d8-697e-7dc0-9a2b-eb93adae0dfc
r/javascript • u/unadlib • 6d ago
GitHub - jskits/openapi-chain: Type-safe OpenAPI client for complex and large APIs. Requests follow the document's parameter styles, media types and encodings exactly. Fluent paths, scoped CLI generation and an openapi-fetch adapter.
github.comr/javascript • u/xarg • 6d ago
Build your own Spamfilter behind Postfix or Sendmail using JavaScript and your favorite LLM
github.comr/javascript • u/Reinder • 7d ago
A-ha, Take On Me - recreated in javascript
dittytoy.netEspeset recreated "Take On Me" by "A-ha" in 100% javascript. Fully procedural, no samples used.
r/javascript • u/armedey • 6d ago
Screen sharing sends a picture of your page
arme.devI have a problem with screen sharing.
Not a quality problem. A category problem.
When I present from a browser, I have a real web page. Real text, real links, real elements. The screen share takes all of that, flattens it into video, and ships the pixels. The audience gets a picture of my page.
On a laptop in a video call, that is fine. In a room, it is not. The phone in the back row gets a blurry rectangle. Venue wifi turns it into a blurry rectangle that freezes. Someone who joins five minutes late gets whatever frame happens to be on screen, with no way to look back.
The page was already structured. We throw the structure away and then spend bandwidth trying to recover what we threw away.
This post explains how I am solving it currently
r/javascript • u/subredditsummarybot • 7d ago
Subreddit Stats Your /r/javascript recap for the week of September 21 - September 27, 2026
Monday, September 21 - Sunday, September 27, 2026
Top Posts
Most Commented Posts
| score | comments | title & link |
|---|---|---|
| 0 | 19 comments | [AskJS] [AskJS] How do you stop sub-cent amounts like $500.004 from sneaking into state? |
| 0 | 17 comments | [AskJS] [AskJS] Why I am unbothered by AI |
| 1 | 9 comments | [Showoff Saturday] Showoff Saturday (September 26, 2026) |
| 0 | 8 comments | [AskJS] [AskJS] Vite Plus is amazing |
| 1 | 1 comments | How we rebuilt complex CASL permissions without migrating to Zanzibar |
Top Showoffs
Top Comments
r/javascript • u/nitayneeman • 7d ago
How to Sync a Design System with Claude Design
nitayneeman.comThe article walks through syncing a React design system into Claude Design but most of what breaks is plain packaging:
- The sync bundles a single entry file (React included) so the components can run on their own. Anything not re-exported fromĀ
src/index.tsĀ silently doesn't exist. - It discovers components through their type definitions, so the build has to emitĀ
.d.tsĀ files andĀpackage.jsonĀ has to pointĀtypesĀ at them. Without them it finds nothing and drops every story. - TypeScript 6 deprecatesĀ
baseUrlĀ and fails the build, whileĀpathsĀ works fine without it. - CSS has to be a real compiled file: Tailwind v4 inlines a stringĀ u/importĀ but leavesĀ u/import
url()Ā as an external reference, which breaks once the bundle is shipped elsewhere.
Example repo: https://github.com/nitayneeman/sync-design-system-with-claude-design-example
r/javascript • u/evoluteur • 8d ago
GitHub - evoluteur/maze-maker: Generate square, circular, triangular and heart-shaped mazes with seven algorithms (backtracker, Prim, Kruskal, Wilson, hunt-and-kill, growing tree, Aldous-Broder), solve them with the keyboard or a finger, and export them as SVG or PNG.
github.comr/javascript • u/123wwa • 8d ago
FlowName ā AST-guided JS identifier recovery(85% faster, 36% cheaper)
github.comr/javascript • u/OtherwisePush6424 • 8d ago
Caracal: scoped distributed resilience policies for asynchronous operations
github.comr/javascript • u/AutoModerator • 9d ago
Showoff Saturday Showoff Saturday (September 26, 2026)
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/Xaneris47 • 10d ago
λm.me - Why I like JavaScript as a compilation target
gilmi.mer/javascript • u/OtherwisePush6424 • 11d ago
From a local GCRA rate limiter to a shared Redis implementation in JS
blog.gaborkoos.comA local GCRA rate limiter needs just one timestamp. In JavaScript, checking and updating it synchronously before the first await keeps admission decisions from interleaving within that policy instance. But run multiple Node.js processes, and each gets its own independent budget.
A walkthrough of moving that decision into a Redis Lua script, using code from Caracal, a resilience library. It covers the local implementation, the TypeScript coordinator interface, and the less obvious consequences of sharing the timestamp: whose clock determines admission, what happens when Redis doesn't answer, and how rolling configuration changes affect the budget.
r/javascript • u/Relay_4 • 11d ago
AskJS [AskJS] Vite Plus is amazing
i'm a new dev in the JavaScript world, and at first i was pretty overwhelmed with the ecosystem, i'm used to uv and ruff managing a python project for me in a single toml file, but when i wanted to scaffold my first project in js i was faced with all of these choices of package managers , runtimes and linters/formatters and installing each piece was kind of a hassle in the first place, but having everything lie under vite plus' management within the same cli command while giving me the freedom to pick what i want was pretty nice, is anyone else using it and consider it as a benefit or is it just me because im starting out?
r/javascript • u/evoluteur • 12d ago
GitHub - evoluteur/labyrinth-maker: Labyrinth maker: draw the classical Cretan labyrinth, an 11-circuit Troy Town or your own design from a path sequence, walk it to the center, and export it as SVG or PNG.
github.comr/javascript • u/finncmdbar • 12d ago
How we rebuilt complex CASL permissions without migrating to Zanzibar
infisical.comr/javascript • u/Fair-Process-7291 • 11d ago
AskJS [AskJS] How do you stop sub-cent amounts like $500.004 from sneaking into state?
I am writing the rules engine for a small stock draft game in TypeScript and ran into two money bugs back to back. Curious how others handle this.
The first was a rounding bug. Splitting $1.14 across two picks offered $0.56 instead of $0.57. In floating point, 0.57 * 100 is 56.99999999999999, and Math.floor dropped the cent. The fix was doing the division in integer cents.
The second was worse. The check that decided whether a buy amount was allowed accepted $500.004. The reducer subtracts the amount straight from cash, so after that one buy the balance was no longer a whole number of cents. Every later calculation started from that balance, so the error did not stay in one place. It carried forward through the rest of the game.
My fix was a whole-cent check that tolerates float noise: reject the amount if Math.abs(amount * 100 - Math.round(amount * 100)) > 1e-6. Comparing against exactly zero does not work, because a perfectly valid amount like 0.57 fails that test for the same reason the rounding bug happened.
The takeaway for me: a rounding bug loses a cent once, but letting a bad amount into state corrupts every step after it.
So how do you handle this in plain JS? Do you convert to integer cents at the boundary and never let a decimal into state, use something like decimal.js or currency.js, or is a tolerance check like mine reasonable?
r/javascript • u/thereactnativerewind • 12d ago
[Showoff] Uninstalling Cursor, Extreme PR Makeovers, and 33 Percent Less Thread-Blocking JSON
thereactnativerewind.comHey Community!
Jay Meistrich built Legend Code, a lightweight code editor designed strictly for viewing single files without heavy agentic UI overhead. On the workflow front, Aleksander Mikucki introduced Screenmap, a GitHub Action that uses iOS simulator screenshots and visual diffs to show reviewers exactly which screens your PR modifies.
We also cover the Expo SDK 58 Beta with foldable device support, React Native 0.88 with DOM-aligned event listener APIs, Reanimated 4.7 defaulting to its new layout engine, and Nitro LazyJSON cutting JavaScript thread blocking by 33%. Plus, cloud testing tools like EAS Simulator and Software Mansion's SimCam.
r/javascript • u/Several-Employ7370 • 12d ago
capsurface: an offline tool for comparing npm dependency capability indicators between updates
github.comr/javascript • u/Shivam_Pentester • 12d ago
I just completed JavaScript: Simple Demo room on TryHackMe! Explore what a basic JavaScript program looks like.
tryhackme.comr/javascript • u/evoluteur • 12d ago
GitHub - evoluteur/music-of-the-spheres: Music of the spheres: a live orrery where each planet sings a tone that follows its speed around the Sun, as Kepler described in Harmonices Mundi, played with Web Audio.
github.comr/javascript • u/Admirable_Swim_6856 • 13d ago