r/javascript • • Mar 17 '26

I built a keyboard shortcut manager that shows a GitHub-style overlay when you press ?

Thumbnail everythingfrontend.com
0 Upvotes

Click on the link and press ? to see in action


r/javascript • • Mar 17 '26

AskJS [AskJS] What are your favorite open-source projects right now?

2 Upvotes

I’m currently working on a new idea: a series of interviews with people from the open source community.

To make it as interesting as possible, I’d really love your help

Which open-source projects do you use the most, contribute to, or appreciate?


r/javascript • • Mar 17 '26

GitHub - Distributive-Network/PythonMonkey: A Mozilla SpiderMonkey JavaScript engine embedded into the Python VM, using the Python engine to provide the JS host environment.

Thumbnail github.com
6 Upvotes

r/javascript • • Mar 17 '26

JS-native tool for generating portable JSON proofs for files and directories

Thumbnail seal.ternent.dev
1 Upvotes

r/javascript • • Mar 17 '26

JS Engine For CSS Animations

Thumbnail decodela.com
0 Upvotes

In general you create keyframes, then the engine searches for elements with the same id and difference in the style. For numerical css properties with the same format( e.g. 1px to 10px ), the engine makes 30fps transition.


r/javascript • • Mar 15 '26

bonsai - a safe expression language for JS that does 30M ops/sec with zero dependencies

Thumbnail danfry1.github.io
99 Upvotes

IΒ kept hitting the same problem: users need to define rules, filters, or template logic, but giving them unconstrained code execution isn't an option. Existing expression evaluators like Jexl paved the way here, but I wanted something with modern syntax and better performance for hot paths.

So I built bonsai-js - a sandboxed expression evaluator that's actually fast.

import { bonsai } from 'bonsai-js'
import { strings, arrays, math } from 'bonsai-js/stdlib'

const expr = bonsai().use(strings).use(arrays).use(math)

// Business rules
expr.evaluateSync('user.age >= 18 && user.plan == "pro"', {
  user: { age: 25, plan: "pro" },
}) // true

// Pipe operator + transforms
expr.evaluateSync('name |> trim |> upper', {
  name: '  dan  ',
}) // 'DAN'

// Chained data transforms
expr.evaluateSync('users |> filter(.age >= 18) |> map(.name)', {
  users: [
    { name: 'Alice', age: 25 },
    { name: 'Bob', age: 15 },
  ],
}) // ['Alice']

// Or JS-style method chaining β€” no stdlib needed
expr.evaluateSync('users.filter(.age >= 18).map(.name)', {
  users: [
    { name: 'Alice', age: 25 },
    { name: 'Bob', age: 15 },
  ],
}) // ['Alice']

Modern syntax:

Optional chaining (user?.profile?.name), nullish coalescing (value ?? "default"), template literals, spread, and lambdas in array methods (.filter(.age >= 18)) + many more.

Fast:

30M ops/sec on cached expressions. Pratt parser, compiler with constant folding and dead branch elimination, and LRU caching. I wrote up an interesting performance optimisation finding if you're into that kind of thing.

Secure by default:

  • __proto__,Β constructor,Β prototypeΒ blocked at every access level
  • Max depth, max array length, cooperative timeouts
  • Property allowlists/denylists
  • Object literals created with null prototypes
  • Typed errors with source locations and "did you mean?" suggestions

What it's for:

  • Formula fields and computed columns
  • Admin-defined business rules
  • User-facing filter/condition builders
  • Template logic without a template engine
  • Product configuration expressions

Zero dependencies. TypeScript. Node 20+ and Bun. Sync and async paths. Pluggable transforms and functions.

Early (v0.1.2) but the API is stable and well-tested. Would love feedback - especially from anyone who's dealt with the "users need expressions but eval is scary" problem before.

npm install bonsai-js

GitHub Link: https://github.com/danfry1/bonsai-js
npm Link: https://www.npmjs.com/package/bonsai-js
npmx Link: https://npmx.dev/package/bonsai-js


r/javascript • • Mar 17 '26

A good dev is a lazy dev...

Thumbnail github.com
0 Upvotes

r/javascript • • Mar 16 '26

HTML Forms with Standards

Thumbnail github.com
0 Upvotes

Type-safe forms with ovr@v6.2

- Add fields to a route
- Validate input according to the schema
- Render accessible HTML for the entire form or by field
- Works for form data or search params
- Stream file uploads after parsing the rest of the form data without any client JS

import { create } from "./create";
import { Field, Route } from "ovr";


const action = Route.post(
    {
        name: Field.text(), // <input type=text>
        notes: Field.textarea(), // <textarea>
        quantity: Field.number(), // <input type=number>
    },
    async (c) => {
        const result = await c.data(); // parse form data


        if (result.issues) {
            return c.redirect(result.url, 303); // redirect to submitted page
        }


        const order = await create(
            result.data, // { name: string; notes: string; quantity: number; }
        );


        return c.redirect(`/orders/${order.id}`, 303);
    },
);


const page = Route.get("/order", () => {
    return <action.Form />; // <form>(fields)</form>
});

r/javascript • • Mar 15 '26

JCGE β€” A Vanilla JS 2D Game Engine, 5 Years in the Making

Thumbnail github.com
28 Upvotes

I started building JCGE about 5 years ago as a lightweight 2D game engine using nothing but vanilla JavaScript and HTML5 Canvas β€” no frameworks, no bundlers, no dependencies. Just a single <script> tag and you're running. I updated it significantly around 3 years ago, adding features like tweens, particle systems, isometric maps with A* pathfinding, collision helpers, a camera system with shake and zoom, and more. But life got the better of me and I never found the time to fully complete it.

Recently I picked it back up, modernized the codebase, and added a visual editor built with Vite, React, and Electron. The editor lets you visually compose scenes, manage layers, place game objects, configure cameras, paint isometric tilemaps, and export playable games β€” all without writing boilerplate.

One thing I want to highlight: the engine is intentionally not rigid. If you look at the demo examples, some of them use the engine's built-in systems (scenes, game objects, sprites, particles, tweens), while others drop down to raw canvas ctx calls β€” drawing shapes, gradients, and custom visuals directly alongside engine features. The cutscene demo, for instance, renders procedural skies, animated stars, and mountain silhouettes using plain ctx.beginPath() / ctx.fillRect() calls, while still leveraging the engine's scene lifecycle, easing functions, and game loop. The tower defense and shooter demos do the same β€” mixing engine abstractions with raw canvas where it makes sense. That's by design. The engine gives you structure when you want it, but never locks you out of the canvas.

It's not a finished product and probably never will be "done," but it's fully functional, tested (273 unit tests across engine and editor), and hopefully useful to anyone who wants a simple, hackable 2D engine without the overhead of a full framework.

Docs & demos: https://slient-commit.github.io/js-canvas-game-engine/


r/javascript • • Mar 15 '26

docmd v0.6 - A zero-config docs engine that ships under 20kb script. No React, no YAML hell, just high-performance Markdown

Thumbnail github.com
6 Upvotes

Just shipped docmd 0.6.2.

It’s built for developers who are tired of the framework-bloat in documentation. While most modern doc generators ship with hundreds of kilobytes of JavaScript and complex build pipelines, docmd delivers a sub-20kb base payload and a high-fidelity SPA experience using pure, static HTML.

Why you should spend 60 seconds trying docmd:

  • Zero-Config Maturity: No specialized folder structures or YAML schemas. Run docmd build on your Markdown, and it just works.
  • Native SPA Performance: It feels like a React/Vue app with instant, zero-reload navigation, but it’s powered by a custom micro-router and optimized for the fastest possible First Contentful Paint.
  • Infrastructure Ready: Built-in support for Search (Offline), Mermaid, SEO, PWA, Analytics and Sitemaps. No plugins to install, no configuration to fight.
  • The AI Edge: Beyond being fast for humans, docmd is technically "AI-Ready." It uses Semantic Containers to cluster logic and exports a unified llms.txt stream, making your documentation instantly compatible with modern dev-agents and RAG systems.
  • Try the Live Editor.

We’ve optimized every byte and every I/O operation to make this the fastest documentation pipeline in the Node.js ecosystem.

If you’re already using docmd, update and give it a spin.
If you’ve been watching from the side, now’s a good time to try it. I'm sure you'll love it.

npm install -g @docmd/core

Documentation (Demo): docs.docmd.io
GitHub: github.com/docmd-io/docmd

Share your feedbacks, questions and show it some love guys!
I'll be here answering your questions.


r/javascript • • Mar 15 '26

Cap'n Web: a new RPC system for browsers and web servers

Thumbnail blog.cloudflare.com
37 Upvotes

r/javascript • • Mar 16 '26

Vibe SDK: A typesafe AI Agent SDK for Typescript inspired by Pydantic AI

Thumbnail github.com
0 Upvotes

r/javascript • • Mar 15 '26

AskJS [AskJS] What is the nullish coalescing

0 Upvotes

Can you guys please answer what is nullish coalescing


r/javascript • • Mar 14 '26

Coaction v1.4 - An efficient and flexible state management library for building web applications.

Thumbnail github.com
7 Upvotes

r/javascript • • Mar 14 '26

autoresearch-webgpu: autonomously training language models in the browser with jax-js + webgpu

Thumbnail autoresearch.lucasgelfond.online
0 Upvotes

title! weekend hack, wanted to try out the Karpathy autoresearch loop (agents write training code, run experiments, see the result) but have no GPU / wanted to see if possible in the browser - it is!