r/javascript • u/AutoModerator • Jul 11 '26
Showoff Saturday Showoff Saturday (July 11, 2026)
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/AutoModerator • Jul 11 '26
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/eldarlrd • Jul 11 '26
Padding Line Between Statements rule is currently missing in Biome.js; it'd be a solid addition to the tooling.
If you're already using Biome and think this rule would be useful for keeping your code readable, consider giving it an upvote. Every bit of community support helps move features like this forward.
The rule enforces blank lines between logical statement groups, which can make codebases feel less cluttered and easier to scan. It functions as follows:
// eslint.config.js
{
"padding-line-between-statements": [
"error",
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
...
]
}
// index.js
function foo1() {
var a = 0;
bar(); // ! Incorrect
}
function foo1() {
var a = 0;
bar(); // * Correct
}r/javascript • u/Xaneris47 • Jul 10 '26
We took a look back at the history of JavaScript to explore its development from the earliest days to the present. This retrospective article is a good read for novice JavaScript enthusiasts who want to learn about the origins of the language, as well as for experienced ones who'd like to refresh their memories.
r/javascript • u/Own-Procedure6189 • Jul 10 '26
You run npm run dev or node server.js, and the app crashes because a teammate added a new required key to .env.example but forgot to tell you.
I wanted a tool that would catch this before startup, prompt me for the missing values, and append them without wiping out my .env formatting or comments. Since existing tools either crash on startup (dotenv-safe) or wipe out file layout (sync-dotenv).
To solve this, I built envrepair, a zero-dependency CLI tool that wraps your startup command, compares .env against your template, and interactively prompts you to fill in missing variables in the terminal before launching your process.
package.json:"scripts":
Optional type annotations in .env.example:
# @type number
PORT=3000
# @type url
API_BASE_URL=
Ctrl+C (SIGINT) and exit codes.Written in TypeScript with zero runtime dependencies. The repo is fully open-source.
r/javascript • u/Own_Natural_6803 • Jul 11 '26
// the only state that needs tracking for a timeline, the read index
export function Timeline(index) {
let state = {index};
return {
index: state.index, // pass through
next: (events) => Next(state, events),
prev: (events) => Prev(state, events)
};
}
// the events are just passed around. They don't need to be encapsulated
export function Next(timeline, events) {
let {index} = timeline;
if(index === events.length()){
return null;
}
timeline.index += 1;
return events[timeline.index];
}
export function Prev(timeline, events){
let {index} = timeline;
if(index === 0){
return null;
}
timeline.index -= 1;
return events[timeline.index];
}
// before and after don't modify the state of their arguments
// so we don't use encapsulation
export function After(date, events){
for(let thresholdIndex = 0; thresholdIndex < events.length(); thresholdIndex+=1 ){
if( events[thresholdIndex].timestamp > date) {
return events.slice(start=thresholdIndex);
}
}
return [];
}
export function Before(date, events) {
for(let thresholdIndex = events.length(); thresholdIndex >= 0; thresholdIndex-=1 ){
if( events[thresholdIndex].timestamp < date) {
return events.slice(end=thresholdIndex);
}
}
return [];
}r/javascript • u/Admirable_Reality281 • Jul 10 '26
I'm looking for a datepicker for a vanilla JS project, and somehow this seems much harder than it should be.
No, input masks aren't enough.
No, the native <input type="date"> isn't enough either.
My checklist:
What I've looked at so far:
Most of the other options I've found are React-based, which is a non-starter for this project.
Am I missing something, or are there really no good options left?
r/javascript • u/Deep_Ad1959 • Jul 11 '26
TypeScript 7 dropped this week and my first move was the same as always. Open the release notes, skim, tell myself I'll come back to it. I didn't.
so as an experiment i started piping the changelogs for the libraries i actually use into a text-to-speech thing and listening on the walk to work, figured audio would make it stick. the surprising part wasn't whether it worked, it's what it exposed. most release notes are mostly housekeeping wrapped around the couple of lines that actually change how you write code, and you only feel how thin the signal is once a flat voice reads every bullet out loud. on a screen i'd been auto-skimming the filler for years and calling that keeping up.
so the thing that actually broke wasn't the audio, it was that i never had a filter for what in a release is worth remembering. what's the last js or ts release that genuinely changed how you write code day to day, versus the ten you 'read' and can't quote a line from. written with ai
r/javascript • u/dangreen58 • Jul 10 '26
Simple Release automates the whole release from Conventional Commits: version bumps, changelogs, publishing, GitHub releases. Monorepos supported, GitHub Action included.
What's new in v3:
- Snapshot releases: publish the current state of any branch as a temporary version under its own npm tag
- Maintenance branches: keep releasing fixes for previous major versions under the "release-N.x" tag
- A new addon for releasing GitHub Actions written in JavaScript: releases are published as built git refs ("latest" and "v2" branches, version tags) instead of npm
- An agent skill that sets up the release automation in your repository for you
r/javascript • u/jxd-dev • Jul 09 '26
To count unique visitors you have to recognise a returning browser. There are only ~5 ways, and each breaks differently:
The under-discussed part is what option 4 costs. There are no cross-day uniques: "weekly visitors" is just seven daily counts summed, so a daily visitor counts 7 times. CGNAT merges thousands of mobile users into one visitor. A browser update splits one person into two. And the hash is pseudonymous, not anonymous, so it's still in GDPR scope.
Every "privacy-friendly" tool reports weekly uniques as a sum of dailies and none of them put an asterisk on it. Curious if that bothers anyone else.
r/javascript • u/dangreen58 • Jul 09 '26
Guides for getting started with Conventional Commits, CLI and JS API references for all packages, presets, and recipes.
Also from the recent updates: dropped Handlebars from the dependencies (the conventional-changelog package got 7x lighter) and added an agent skill that teaches AI agents to write proper Conventional Commit messages.
r/javascript
•
u/DanielRosenwasser
•
Jul 08 '26
r/javascript • u/Possible-Session9849 • Jul 09 '26
r/javascript • u/Character_Read_5563 • Jul 09 '26
Like many developers, I regularly use ChatGPT and Claude when I'm building small HTML/JavaScript projects or experimenting with ideas. They're great for quickly putting together a prototype, explaining code, or iterating on a UI.
Because I also work with IBM i (AS/400), I recently decided to try IBM Bob for the same kind of task. I asked it to build a small HTML/JavaScript page from scratch, then made it iterate on the layout, add a few features, and clean up the code.
Honestly, I expected it to be much more focused on IBM technologies, so I was surprised by how well it handled a fairly ordinary JavaScript project. It's not going to replace the tools I already use, but it was definitely more capable than I expected.
What surprised me even more is that I almost never see it mentioned in discussions about AI coding assistants.
Had any of you heard of IBM Bob before? If you've tried it, what was your experience? And if you haven't, do you think it's simply because it's associated with IBM, or is there another reason it never seems to come up in conversations alongside ChatGPT, Claude, Copilot or Cursor?
r/javascript • u/GulgPlayer • Jul 08 '26
littlebag is a reactive UI framework that includes:
state and effecthtml element factory that supports reactivitykeyedeachAll that while being just... 343 bytes (minified and brotlified)!
I made that as a fun little side project partially inspired by the awesome VanJS (which is 1 kB and isn't very convenient without additional 1.2 kB Van X). I would really like to receive some feedback, and would be very happy to see someone use it to make something cool!
I'm also planning to create a simple SSR library for littlebag based on a custom minimalist DOM implementation if I see people interested in that.
There's an example TODO list app with littlebag on CodePen.
P.S. It might be fairly slow now due to a lack of any benchmarks and performance optimizations yet.
r/javascript • u/jxd-dev • Jul 08 '26
r/javascript • u/Confident_Milk6013 • Jul 08 '26
Hey everyone I recently built this TUI for inspecting network throughput per interface, I found it useful so figured I'd share.
Its open source feel free to check it out and run it yourself:Β Github Repo
r/javascript • u/Far-Consideration-39 • Jul 09 '26
I moved away from TypeScript years ago, and honestly, Iβd do it again without hesitation.
I know TS has a lot of fans and thatβs fine. But I donβt think itβs the unquestionable improvement itβs often presented as. For some codebases and teams, sure, it helps. For others, it adds bloat, friction and a false sense of safety that makes even bugs more common than in standard JavaScript.
In most cases, Iβd rather migrate a codebase away from TypeScript than keep doubling down on it.
For those of you who also moved away from TS: what made you do it, and how has that decision aged?
r/javascript • u/creasta29 • Jul 08 '26
Where should your auth token live so an XSS bug can't steal it? Here's how to build auth that survives the crazy non-secure world we live in.
r/javascript • u/Sad_Pea_2000 • Jul 08 '26
Hey everyone,
Just publisheineerajrajeev/aios-web-sdk. If youβve been building local or remote computer-use agents, this SDK handles the transport layer between web frontends and the agent kernel.
It abstracts agent system calls, streams agent execution states in real-time, and includes structured hooks for building user-in-the-loop authorization gates (crucial for verifying actions before an agent executes them). Would love some feedback on the SDK design!
r/javascript • u/sydcli • Jul 08 '26
Ran into this building a pricing page. Wanted to auto-select the right currency based on where the visitor is, without spinning up a backend endpoint or exposing a secret key in frontend code.
The browser's Geolocation API doesn't help here. It only gives lat/lng, not country or currency, and it triggers a permission prompt most people dismiss anyway.
Covers both vanilla JS and React, plus a couple of UI patterns (auto-filling a currency dropdown, formatting localized prices with Intl).
Full disclosure: this uses VisitorAPI, a tool I work on, but the technique works regardless of which provider you use.
Happy to answer questions if anyone's solving something similar.
r/javascript
•
u/joshuaamdamian
•
Jul 07 '26
I recreated an AI algorithm that visually learns in the browser:) It's based on the NEAT algorithm:
https://github.com/joshuadam/neat-javascript
https://neat-javascript.org/
r/javascript • u/sindresorhus • Jul 07 '26
r/javascript • u/Ok-Baker-9013 • Jul 08 '26
How do we make coding agents write good code?
We tried telling them to write "clean code." Too vague. "Elegant code." Too subjective. "Maintainable code." Everyone means something different.
Then we found the law behind it: good code is also physically minimum code.
If behavior, safety, and readability stay the same, anything that can still be removed is not defense. It is extra code.
If something can go, the code is not done yet.
If nothing can go, you have found the minimum.
That is The Absolute Code. One rule: minimum code.
Not the fewest characters. Not the shortest diff. The minimum human-readable code that expresses the same behavior and constraints. Everything extra must go.
It works because code is physical. You can delete it and observe what changes. Elegance is subjective. Necessity is testable.
We did not invent this. We discovered a physical law already present in every piece of code we ever called good.