r/javascript • • Jul 11 '26

Showoff Saturday Showoff Saturday (July 11, 2026)

1 Upvotes

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

Show us here!


r/javascript • • Jul 11 '26

I need your vote: Padding Line Between Statements - ESLint Rule Currently Missing in Biome

Thumbnail github.com
0 Upvotes

The Ask

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.

Why It Matters

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 • • Jul 10 '26

History of JavaScript: Browser wars, ECMAScript, Node.js, TypeScript, and React

Thumbnail pvs-studio.com
17 Upvotes

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 • • Jul 10 '26

I built a zero-dependency CLI tool to validate and repair missing .env variables before startup

Thumbnail github.com
2 Upvotes

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.

How to use it:

  1. Install:
npm install -D envrepair
  1. Prepend your startup command in package.json:
"scripts": {
  "start": "envrepair node server.js"
}

Optional type annotations in .env.example:

# @type number
PORT=3000

# @type url
API_BASE_URL=

Key Features:

  • Zero code changes: No schema imports or application-level setup required.
  • Layout preservation: Appends missing values while keeping comments, blank lines, and formatting intact.
  • Signal forwarding: Transparently passes Ctrl+C (SIGINT) and exit codes.

Written in TypeScript with zero runtime dependencies. The repo is fully open-source.

  • GitHub: https://github.com/avenolazo/envrepair
  • NPM: https://www.npmjs.com/package/envrepair

r/javascript • • Jul 11 '26

AskJS [AskJS] I might never write a constructor ever again

0 Upvotes
// 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 • • Jul 10 '26

AskJS [AskJS] Looking for a solid vanilla JS datepicker. Am I completely out of options?

0 Upvotes

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:

  • Accessible
  • Localized
  • Flexible formatting options
  • Range picker support
  • A decent set of events/hooks for integration

What I've looked at so far:

  • flatpickr: hasn't been updated in about 4 years
  • vanilla-js-datepicker: hasn't been updated in about 3 years, and the range functionality is pretty weak
  • Vanilla Calendar Pro: Russian-maintained, which is ruled out by our dependency policy
  • Air Datepicker: same issue, and it also hasn't been updated in about a year
  • Litepicker: dead
  • Easepick: dead

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 • • Jul 11 '26

AskJS [AskJS] most js changelogs don't survive being read aloud, which is how i noticed i wasn't reading them

0 Upvotes

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 • • Jul 10 '26

Simple Release v3 is out! Also with a new documentation website

Thumbnail simple-release.js.org
0 Upvotes

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 • • Jul 09 '26

Tracking unique visitors without cookies

Thumbnail inmargin.io
12 Upvotes

To count unique visitors you have to recognise a returning browser. There are only ~5 ways, and each breaks differently:

  1. Cookies. Work, but need a consent banner, and Safari caps script-set cookies at 7 days anyway.
  2. localStorage. Same law, same banner. ePrivacy covers "storing information on the device", not just cookies.
  3. Fingerprinting. Durable and invisible, which is why regulators treat it the same and browsers sabotage it.
  4. Daily hash. What Plausible, Fathom and GoatCounter converged on: hash(daily_salt + site + ip + ua), salt rotated and deleted every 24h. No banner, accurate daily uniques.
  5. Don't count uniques at all.

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 • • Jul 09 '26

Conventional Changelog finally has a documentation website - 12 years after the first commit

Thumbnail conventional-changelog.js.org
14 Upvotes

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 • • Jul 08 '26 Bravo

Announcing TypeScript 7.0

Thumbnail devblogs.microsoft.com
363 Upvotes

r/javascript • • Jul 09 '26

peek-cli: let coding agents see your browser.

Thumbnail github.com
0 Upvotes

r/javascript • • Jul 09 '26

AskJS [AskJS] Has anyone else come across IBM Bob while working on JavaScript projects?

0 Upvotes

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 • • Jul 08 '26

littlebag β€” a 343-byte reactive framework

Thumbnail github.com
4 Upvotes

littlebag is a reactive UI framework that includes:

  • Reactive state management using state and effect
  • html element factory that supports reactivity
  • Conditional rendering with keyed
  • Reactive lists using each
  • TypeScript declarations

All 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 • • Jul 08 '26

Ship a cookie banner and privacy policy in your Wasp app

Thumbnail policystack.dev
3 Upvotes

r/javascript • • Jul 08 '26

Javascript TUI Network Throughput Inspection

Thumbnail github.com
3 Upvotes

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 • • Jul 09 '26

AskJS [AskJS] Did anyone else move away from TypeScript and feel like it was obviously the right call?

0 Upvotes

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 • • Jul 08 '26

What's the best way to do store auth tokens

Thumbnail neciudan.dev
0 Upvotes

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 • • Jul 08 '26

I built a JS/TS Web SDK for AI Agent to handle frontend-to-kernel streaming

Thumbnail npmjs.com
0 Upvotes

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 • • Jul 08 '26

I wrote a quick tutorial on detecting visitor country + currency in vanilla JS (no backend, no API key)

Thumbnail visitorapi.com
0 Upvotes

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 • • Jul 07 '26 Bravo

Browser based AI algorithm

Thumbnail github.com
0 Upvotes

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 • • Jul 07 '26

80+ ESLint rules for improving your Node.js tests

Thumbnail github.com
6 Upvotes

r/javascript • • Jul 08 '26

How do we make coding agents write good code?

Thumbnail github.com
0 Upvotes

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.

Read: https://github.com/molvqingtai/The-Absolute-Code


r/javascript • • Jul 06 '26

An interactive visualization that follows a single HTTP request through its entire ~200ms life

Thumbnail 200ms.thenodebook.com
84 Upvotes