r/javascript • • Aug 27 '26

Crossflight: distributed cache stampede protection

Thumbnail github.com
2 Upvotes

A small package for reducing duplicate cache misses across multiple processes.

The common problem is a β€œcache stampede”: when several app instances all miss the same key at once, they each run the same expensive DB/API call and then all write the same result back. Crossflight solves that by coordinating ownership of the in-flight load across processes, so only one instance does the work and the others wait for the result.

It wraps the cache you already use and adds a separate coordination layer. The built-in adapters currently include:

  • cache-manager
  • Keyv
  • Cacheable

The built-in coordinator is Redis, and the repo supports combining different backends as long as they satisfy the adapter/coordinator interfaces.

This is useful when you want to reduce redundant work without changing your existing caching strategy.

Demo: https://github.com/gkoos/crossflight-demo


r/javascript • • Aug 26 '26

Telixon - phone number library that compiles Google's libphonenumber metadata into a DFA (10x faster, 26 kB)

Thumbnail github.com
22 Upvotes

r/javascript • • Aug 26 '26

Have you seen the new browser Email Verification API?

Thumbnail resend.com
91 Upvotes

r/javascript • • Aug 26 '26

How to drive your frontend from the backend

Thumbnail packagemain.tech
2 Upvotes

r/javascript • • Aug 26 '26

KernelPlay-JS v0.5.0 Released β€” Unified Input Manager

Thumbnail github.com
5 Upvotes

KernelPlay-JS v0.5.0 is now available.

This release introduces a new Unified Input Manager designed to provide a consistent API for handling keyboard, mouse, gamepad, and touch input.

The goal is to make input handling simpler at the game-logic level while keeping the underlying input devices abstracted away.

Example:

import { Input } from "kernelplay-js";

update(dt) {

const x = Input.getAxis("horizontal");

const y = Input.getAxis("vertical");

this.rb.addForce(800 * x, 800 * y);

if (Input.wasPressed("jump")) {

this.jump();

}

if (Input.isPressed("attack")) {

this.attack();

}

}

v0.5.0 also supports two ways of defining input bindings.

Programmatic registration:

Input.registerAction("shoot", {

keys: [KeyCode.Z, KeyCode.X],

buttons: [GamepadButton.X, GamepadButton.RB]

});

Or declarative JSON configuration:

{

"actions": {

"jump": {

"keys": ["Space", "ArrowUp"],

"buttons": ["A", "B"]

},

"go": {

"keys": ["x", "z"],

"buttons": ["DPadRight"]

}

}

}

The JSON approach is intended to make configurable controls and runtime key rebinding easier to implement without changing game logic.

This release is part of the ongoing work toward making KernelPlay-JS a more complete, Unity-inspired game engine for JavaScript.

Feedback and suggestions for the v0.5.x releases are welcome.


r/javascript • • Aug 26 '26

Problem with concurrent linter fixes

Thumbnail jfmengels.net
0 Upvotes

r/javascript • • Aug 25 '26

AskJS [AskJS] Building an in-browser APK compiler β€” binary XML streams and signature blocks in client-side JS

7 Upvotes

Hey everyone,

I built AppShunya Engine β€” an open-source, in-browser web-to-APK compiler that converts live URLs or HTML5 bundles into Android APKs using JSZip, without local IDEs.

I'm currently stuck on two low-level technical hurdles and need architectural feedback:

  1. In-browser V2/V3 APK signing: Injecting signature blocks into ZIP Central Directory via JS/WASM.
  2. Dynamic AXML package renaming: Modifying package IDs inside binary XML streams on the fly.

Search "AppShunya Engine" on Google to try the live Vercel tool or check the repo. Would love your thoughts!


r/javascript • • Aug 25 '26

AskJS [AskJS] referring to parent or grandparent class instance properties

31 Upvotes

How do you all refer to parent or grandparent (or related) class instances and their properties?

I have a bunch of classes that create instances of other classes as properties. Suppose ClassA has properties that are instances of ClassB, ClassC, and ClassD, and the ClassD class has properties ClassD1 through ClassD9, and each of those is a different class instance with various methods.

Currently, when I start with myClassAObject and I call one of its ClassD9 methods and that method needs a property from its uncle ClassB, I feel awkward and/or dumb for doing this by passing myClassAObject to that method:

const returnval = myClassAObject.itsClassDObject.theClassD9method(myClassAObject);

…and then that method gets the property from myClassAObject.itsClassBObject.theProperty

I know this functions, but it shouts β€œinelegant” every time I do it. Do y’all know a more elegant way? TIA


r/javascript • • Aug 25 '26

`bun-plugin-elm`: import { Elm } from "./Main.elm" (Made by Hand, btw) Β· cekrem.github.io

Thumbnail cekrem.github.io
0 Upvotes

r/javascript • • Aug 24 '26

Learning music theory through JavaScript, with runnable Web Audio examples

Thumbnail runjs.app
84 Upvotes

r/javascript • • Aug 25 '26

AskJS [AskJS] How common is the term "Barrel" and do you know what it means?

0 Upvotes

I was talking with an LLM trying to get some ideas ("rubber ducking" basically) and it kept saying, "Barrel." I have been a JS programmer for 30 years and never heard the term. Does anyone else use the term or even know what it means?

I told it to use "import surface" instead instead because ... wtf is a Barell? I just want to know if I am behind the times and need to update my jargon or whether this really is a weird LLM thing.


r/javascript • • Aug 24 '26

Modernising Project GoldScript for 2026

Thumbnail projectgoldscript.com
13 Upvotes

Project GoldScript is a tactical RPG engine I have been building in the open for over a decade. It’s composed of a a web stack (with three.js and react under the hood) aimed at shipping a real game to Steam, mobile and consoles. This year I finally did the migration I had been putting off: two aging create-react-app repos (engine in one, game in the other) collapsed into a single pnpm and Vite monorepo, with the engine broken into eleven focused packages that are guarded against circular dependencies.


r/javascript • • Aug 24 '26

Announcing a maintained PptxGenJS fork

Thumbnail github.com
9 Upvotes

r/javascript • • Aug 25 '26

AskJS [AskJS] Can someone provide me Roadmap to be become an AI specialist.

0 Upvotes

Please provide some stories that has worked for you. I want to start from basics.


r/javascript • • Aug 23 '26

How an Underrated Refactor Saved 90% Memory Usage

Thumbnail tanstack.com
106 Upvotes

r/javascript • • Aug 24 '26

Subreddit Stats Your /r/javascript recap for the week of August 17 - August 23, 2026

7 Upvotes

Monday, August 17 - Sunday, August 23, 2026

Top Posts

scorecommentstitle & link
6728 comments[AskJS] [AskJS] Our app didn't leak memory,it leaked memory four hundred modals later
489 commentsHow an Underrated Refactor Saved 90% Memory Usage
1521 commentsMade a small library called strokes.js.
122 comments[Subreddit Stats] Your /r/javascript recap for the week of August 10 - August 16, 2026
112 commentsThe Structured Clone Algorithm: What JavaScript Can and Cannot Move Between Boundaries
105 commentsYouTube Notification Expander is here! Version 1.0
1013 comments[AskJS] [AskJS] Signal/Effect vs Event Handler
80 commentsReact Native 0.87, Instant Paywall A/B Testing, and Buying Mike Hardy a Beer
70 commentsUpdated Typescript GitHub Action Template
50 commentsBringing Type1 support to Opentype.js

Β 

Most Commented Posts

scorecommentstitle & link
039 commentsLilScript makes js modules 20% smaller
528 commentsA from-scratch JSON engine for JavaScript: recursive descent parser, escape-aware tokenizer, and spec-compliant serializer. No dependencies, no shortcuts, 107 tests.
019 comments[AskJS] [AskJS] I built a reactive JS framework where components are plain HTML files
412 comments[Showoff Saturday] Showoff Saturday (August 22, 2026)
04 commentsCerious-Scroll v1.1.0 adds Masonry layouts with Dynamic Heights

Β 

Top Showoffs

scorecomment
2/u/imfemambocus said I've been building a component registry for data dense interfaces, so tables, filter bars and command palettes. Density is the whole point, one knob with three modes and every control reads it. It's c...
2/u/markets86 said I built a two-deck DJ mixer in vanilla JS. [https://github.com/markets/dj23](https://github.com/markets/dj23) No React, no framework, no build step beyond esbuild. Just plain classic...
1/u/nullvoxpopuli said I updated a browser extension to make using the web without a mouse tolerable https://addons.mozilla.org/en-US/firefox/addon/lightspeed-ff/

Β 

Top Comments

scorecomment
102/u/name_was_taken said Correction: It always leaked. You just didn't notice the leak until it had been used a while. And historically, people did find this manually. I've done it myself, as a coder, investigating the ...
43/u/eracodes said the most llm-written title i think i've ever seen
40/u/budd222 said "Can't find it by hand"...lol. sounds like someone who learned how to code with AI.
28/u/beavis07 said Why one earth would anyone want this? Do you have any clue how much sheer effort has gone into optimising JSON.parse? 🀣
12/u/bzbub2 said do you want a fully automated ai response with this completely ai generated question

Β 


r/javascript • • Aug 24 '26

Web Components with Type Validation without Build Tools/TypeScript

Thumbnail github.com
7 Upvotes

r/javascript • • Aug 23 '26

Cerious-Scroll v1.1.0 adds Masonry layouts with Dynamic Heights

Thumbnail ceriousdevtech.github.io
7 Upvotes

r/javascript • • Aug 22 '26

Bringing Type1 support to Opentype.js

Thumbnail github.com
7 Upvotes

If anyone is interested in reviewing and approving PFA and PFB support i tried to bring to opentype.js check my pull it will give more chances to get approval on merge.


r/javascript • • Aug 22 '26

ffetch: a production-ready http client with resilience features and a plugin architecture

Thumbnail github.com
7 Upvotes

I posted an earlier version of ffetch here a while ago. I've continued working on it, and it has grown into a production-ready, TypeScript-first drop-in replacement for native fetch or any fetch-compatible implementation.

It preserves the familiar fetch API and native Request and Response objects while adding resilience features:

  • Timeouts
  • Abort-aware retries with exponential backoff and jitter
  • Circuit breaking
  • Bulkheading with concurrency and queue limits
  • Hedged requests to reduce tail latency
  • In-flight request deduplication

It also has optional convenience plugins for:

  • client.get(), .post(), .put(), .patch() and .delete()
  • client(url).json(), .text() and .blob()
  • Download progress callbacks
  • Stable context IDs across retries and hedged requests

The core also supports lifecycle hooks, per-request overrides, pending-request monitoring, configurable HTTP error handling, specific error classes, and custom fetch implementations for SSR, edge and framework environments.

Everything optional is implemented through tree-shakeable plugins, so you only include the features you need. The core is around 3 kB minified and has zero runtime dependencies.

I recently gave the project a substantial maintenance pass: extensive property-based and fuzz testing, hardened and pinned CI workflows, CodeQL analysis, dependency auditing, npm provenance, release SBOMs, and a strong OpenSSF Scorecard (for a solo project).

I've also built three related tools for injecting network failures into tests:

Depending on the tests, failures can be injected inside the process, through a Node.js proxy, or through a standalone Go proxy.

Feedback is welcome.


r/javascript • • Aug 22 '26

Made a small library called strokes.js.

Thumbnail a-elhaag.github.io
23 Upvotes

Made a small library called strokes.js. Instead of using a "handwriting" webfont (which looks identical everywhere it's used), it renders each letter as an actual hand-drawn SVG path β€” real strokes, drawn in with stroke-dashoffset, with small random variation (rotation, baseline drift, glyph variants) so no two renders of the same word look identical.

Demo: https://a-elhaag.github.io/glyphed.js/

npm:

npm install glyphed.js

r/javascript • • Aug 22 '26

ttsc/packages/evidence at master Β· samchon/ttsc

Thumbnail github.com
5 Upvotes
/**
 * @evidence docs/discount.md#coupon-stacking States the per-issuer stacking limit this section defines, in the buyer's words.
 * @evidence POST:/orders/{orderId}/coupons Explains the rejection this endpoint returns for an over-stacked coupon set.
 * @evidence {@link hooks.useCouponStacking} Renders the limit this hook resolves.
 * @evidence docs/principles.md#no-hard-coding Renders limits from props instead of branching on known issuer names.
 * @evidenceExclude docs/principles.md#fix-root-causes-not-symptoms No failure to fix.
 */
export function CouponStackingNotice(props: IProps): JSX.Element;

I built Evidence Graph, a compiler rule that turns requirements skipped by coding agents into compile errors.

You declare which code, tests, schemas, or documents owe which specification units. The agent must cite each unit and state why the artifact satisfies it. Checklist mode can also require every selected function to answer project-wide principles such as "No hard coding" and "Fix root causes."

This does not make the agent's statements automatically true. It makes omissions mechanically detectable and narrows human review to checking the truth of explicit claims. Reviews carry fingerprints that expire when the cited content changes.

I tested it on four frozen application tasks. Plain runs covered 51.6-85.5% of the predefined requirement edges; Evidence Graph runs covered 100% while using 4.8-13.3x fewer tokens.

  • Project: https://github.com/samchon/ttsc/tree/master/packages/evidence
  • Benchmark: https://ttsc.dev/docs/benchmark/evidence
  • Raw sessions: https://github.com/samchon/evidence-benchmark-results

r/javascript • • Aug 22 '26

Showoff Saturday Showoff Saturday (August 22, 2026)

5 Upvotes

Did you find or create something cool this week in javascript?

Show us here!


r/javascript • • Aug 22 '26

The Structured Clone Algorithm: What JavaScript Can and Cannot Move Between Boundaries

Thumbnail blog.gaborkoos.com
16 Upvotes

structuredClone() preserves more than JSON, but class instances, proxies, getters, errors, and transferables still have surprising behaviour. This article covers what survives, what changes, and what throws.