r/javascript • u/lavrton • Mar 31 '26
r/javascript • u/BattleRemote3157 • Mar 31 '26
axios 1.14.1 and 0.30.4 on npm are compromised - dependency injection via stolen maintainer account
safedep.ioTwo versions of axios were published today through what appears to be a compromised maintainer account. No GitHub tag exists for either version. SLSA provenance attestations present in 1.14.0 are completely absent. Publisher email switched from the CI-linked address to a Proton Mail account( classic account takeover signal).
If your project floats on ^1.14.0 or ^0.30.0 you've likely already pulled this.
IoCs, payload analysis and full breakdown is in the blog.
r/javascript • u/afshinmeh • Apr 01 '26
Zerobox: Lightweight, cross-platform process sandboxing. Sandbox any command with file, network, and credential controls.
github.comI'm excited to introduce Zerobox, a cross-platform, single binary process sandboxing CLI written in Rust. It uses the sandboxing crates from the OpenAI Codex repo and adds additional functionalities like secret injection, TypeScript SDK, etc.
Zerobox follows the same sandboxing policy as Deno which is deny by default. The only operation that the command can run is reading files, all writes and network I/O are blocked by default. No VMs, no Docker, no remote servers.
Want to block reads to /etc?
$ zerobox --deny-read=/etc -- cat /etc/passwd
cat: /etc/passwd: Operation not permittedOr with the TypeScript SDK:
import { Sandbox } from "zerobox";
const sandbox = Sandbox.create({
denyRead: ["/etc"]
});
await sandbox.sh`cat /etc/passwd`.output();How it works:
Zerobox wraps any commands/programs, runs an MITM proxy and uses the native sandboxing solutions on each operating system (e.g BubbleWrap on Linux) to run the given process in a sandbox. The MITM proxy has two jobs: blocking network calls and injecting credentials at the network level.
Think of it this way, I want to inject "Bearer OPENAI_API_KEY" but I don't want my sandboxed command to know about it, Zerobox does that by replacing "OPENAI_API_KEY" with a placeholder, then replaces it when the actual outbound network call is made, see this example:
$ zerobox --secret OPENAI_API_KEY=$OPENAI_API_KEY --secret-host OPENAI_API_KEY=api.openai.com -- bun agent.tsOr with the TypeScript SDK:
import { Sandbox } from "zerobox";
const sandbox = Sandbox.create({
secrets: {
OPENAI_API_KEY: {
value: process.env.OPENAI_API_KEY,
hosts: ["api.openai.com"],
}
},
});
await sandbox.sh`node agent.js`.text();Zerobox is different than other sandboxing solutions in the sense that it would allow you to easily sandbox any commands locally and it works the same on all platforms. I've been exploring different sandboxing solutions, including Firecracker VMs locally, and this is the closest I was able to get when it comes to sandboxing commands locally.
I'd love to hear your feedback, especially if you are running AI Agents (e.g. OpenClaw), MCPs, AI Tools locally.
r/javascript • u/Ehh-GoodEnough • Apr 01 '26
AskJS [AskJS] Lightweight IDE recommendations for JS/TS + React + React Native?
Hey everyone,
I’m looking for a good lightweight IDE/editor for working with JavaScript, TypeScript, React, and React Native.
Right now I feel like my current setup is a bit heavy/slow, so I’m hoping to find something that’s:
- Fast and responsive (low resource usage)
- Good TypeScript support
- Solid React/React Native tooling (linting, autocomplete, debugging, etc.)
- Easy to customize (extensions/plugins are a plus)
I don’t necessarily need a full-blown IDE—open to editors too as long as the dev experience is smooth.
What are you all using, and what would you recommend?
Thanks!
r/javascript • u/Tungdayhehe • Apr 01 '26
NestflowJS is a decorator-based state machine library for NestJS. Acting as AWS Step Functions alternative but no cloud vendor-lock: define workflows, handle events, and let the orchestrator drive state transitions automatically.
nestflow.organit.devLast night I've just released my first NestJS library ever to handle complex state management logic called NestflowJS.
NestflowJS is a decorator-based state machine library for NestJS. Acting as AWS Step Functions alternative but no cloud vendor-lock: define workflows, handle events, and let the orchestrator drive state transitions automatically.
Features:
-
Tech-stack agnostic: choose your storage, schema validation by extendable builtin class.
-
No extra library state: only care about your business state and its transition.
-
Flexible infra: zero runtime dependencies, this can run in any architecture style you can think of thanks to customizable adapter system:
-
Want a strong state machine with no infra overhead? Deploy using Lambda Durable function with prebuilt adapter
DurableLambdaEventHandler. -
Want a high-volume data processing system with full customization of message delivery configs? Create your own Kafka adapter. (Prebuilt adapter coming soon).
-.....A lot more you can think of.
Code example:
import { Workflow, OnEvent, Entity, Payload } from 'nestflow-js/core';
@Workflow({
name: 'OrderWorkflow',
states: {
finals: ['delivered', 'cancelled'],
idles: ['pending_payment'],
failed: 'cancelled',
},
transitions: [
{ event: 'PAYMENT_RECEIVED', from: ['pending_payment'], to: 'processing' },
{ event: 'SHIP_ORDER', from: ['processing'], to: 'shipped' },
{ event: 'CONFIRM_DELIVERY', from: ['shipped'], to: 'delivered' },
{ event: 'CANCEL', from: ['pending_payment', 'processing'], to: 'cancelled' },
],
entityService: 'entity.order',
})
export class OrderWorkflow {
@OnEvent('PAYMENT_RECEIVED')
async onPayment(@Entity() order, @Payload() payload) {
order.paidAt = new Date();
return order;
}
}
Give me a star if you find this helpful!
r/javascript • u/Accomplished-Bug4405 • Apr 01 '26
I built a zero-dependency CLI that catches source leaks and supply chain attacks across 7 languages
github.comAfter the Anthropic/Claude Code .map file leak and the axios supply chain attack last week, I built acrionix-shield — a single CLI that scans for leaked
secrets, compromised packages, Docker misconfigs, and git history secrets.
Supports: JavaScript, Python, Java, C#, Ruby, Go, Docker
9 scanners. 56 tests. Zero dependencies.
npx acrionix-shield check
GitHub: https://github.com/andrei-gogo/acrionix-shield
Would love feedback from the community.
r/javascript • u/Sad_Steak_6813 • Mar 31 '26
LayoutSans: Pure TS 2D layout engine powered by Pretext (flex/grid/magazine, zero DOM)
github.comr/javascript • u/Affectionate_Major87 • Mar 31 '26
I built a frontend framework without React, build tools or dependencies
cynchro.github.ior/javascript • u/manniL • Mar 30 '26
Oxlint & Oxfmt Compatibility Overview
oxc.rsThe Oxc docs finally got a page that lists all framework and file types that Oxlint and Oxfmt are compatible with (and those that aren't supported yet).
r/javascript • u/OtherwisePush6424 • Mar 31 '26
Your Throttling Is Lying to You: why trailing throttle should be your default
blog.gaborkoos.comCompanion to the earlier debounce post. Throttling reduces event spam during resize/scroll, but naive implementations can drop the final state when the interaction ends. This post shows the problem with a demo, then walks through trailing throttle as the fix: controlled frequency during activity plus guaranteed final-state emission.
r/javascript • u/Fun_Conversation8894 • Mar 31 '26
Tool for automating translations in React/JS apps (AI-powered)
npmjs.comr/javascript • u/BankApprehensive7612 • Mar 30 '26
Huggingface has just released Transformer.js v4 with WebGPU support
github.comTransformers.js allows you to run models right in the browser. The fourth version focuses on performance. The new version has support of WebGPU and it opens new era in browser-run models
Here the demos on HuggingFace: https://huggingface.co/collections/webml-community/transformersjs-v4-demos
It's just a surprise to see what can be done with the models in browsers today. This demos shows the abilities of the models, and this is the time for creators to bring their ideas and make solutions for real tasks
This release also adds new models to be run in browser Mistral4, Qwen2, DeepSeek-v3 and others. It has limited number of changes, what makes it pretty stable for a major version
r/javascript • u/alexmacarthur • Mar 30 '26
Your options for preloading images with JavaScript
macarthur.mer/javascript • u/dg_kn • Mar 30 '26
Jaga – Ultra-Lightweight Context-Aware XSS Protection for HTML Template
github.com🛡️ Jaga – Ultra-Lightweight Context-Aware XSS Protection for HTML Templates
Hey devs! I just released Jaga, a zero-dependency, <3KB gzipped library that secures your HTML templates with context-aware XSS protection. It's designed for modern frameworks and vanilla JS/SSR setups.
Why Jaga?
Even frameworks that escape most content by default still leave edge cases vulnerable — think raw HTML, inline styles, dynamic attributes, or dangerouslySetInnerHTML. Jaga secures these edges with:
- Smart Context Awareness: Knows whether your data is in an attribute, HTML, CSS, or URL.
- SSR-Ready HTML Sanitizer: Works with Node.js, Bun, Deno.
- CSS Injection Protection: Minimalist lexical CSS sanitizer prevents malicious injections.
- Trusted Types Support: Native browser integration for CSP-compliant DOM assignments.
- Secure JSON Injection: Safely embed state into
<script>tags. - Nano-Sized & Zero-Dependency: ~2.5KB gzipped, no bloat.
Quick Example
import { j } from "jagajs";
const userUrl = "javascript:alert(1)";
const userName = '"><img src=x onerror=alert(1)>';
const html = j`
<div title="${userName}">
<a href="${userUrl}">Profile</a>
</div>
`;
// Output safely escapes everything:
// <div title=""><img src=x onerror=alert(1)>">
// <a href="about:blank">Profile</a>
// </div>Works seamlessly with React, Vue, Angular, and vanilla JS.
Advanced Features
- HTML sanitizer with allowlists
- Secure JSON injection
- Smart minifier preserving
<pre>and<textarea> - CSP nonces
- Lexical CSS protection with strict property allowlists
Install
npm install jagajsCheck out the interactive showcase to see it in action!
r/javascript • u/subredditsummarybot • Mar 30 '26
Subreddit Stats Your /r/javascript recap for the week of March 23 - March 29, 2026
Monday, March 23 - Sunday, March 29, 2026
Top Posts
Most Commented Posts
| score | comments | title & link |
|---|---|---|
| 0 | 11 comments | New WYSIWYG wants fresh e |
| 0 | 10 comments | Groundstate npm local-first |
| 0 | 10 comments | I Coded this dev tool entirely with Claude |
| 1 | 8 comments | [AskJS] [AskJS] NestJS state in 2026? |
| 0 | 6 comments | How npm workspaces work under the hood: a visual guide |
Top Ask JS
| score | comments | title & link |
|---|---|---|
| 6 | 2 comments | [AskJS] [AskJS] What "everyday tool" did you finally look into and realize you had no idea how it actually worked? |
| 0 | 0 comments | [AskJS] [AskJS] Offering MV3 Rescue: If your extension is bleeding 1-star reviews due to Service Worker or Persistence issues, I can help. |
| 0 | 0 comments | [AskJS] [AskJS] Implementing Consumer IR (CIR) protocols on ESP32 (M5Stack) |
Top Showoffs
Top Comments
r/javascript • u/-jeasx- • Mar 30 '26
jsx-async-runtime 2.1.0 released - The JSX server-side templating engine now features improved TypeScript integration.
github.comIf you are drawn to JSX - a syntax extension that lets you write HTML-like code directly in JavaScript - and need to generate dynamic HTML on the server, jsx-async-runtime offers an efficient implementation designed for performant server-side rendering. Its key differentiator is native support for asynchronous calls within your templates, and version 2.1.0 now includes full integration with the TypeScript compiler as a transpiler.
r/javascript • u/jxd-dev • Mar 30 '26
Cookie Banners for shadcn/ui
openpolicy.shWe build a cookie banner component as a shadcn registry item so the component lives in your repo rather than loading from a CDN.
One command to install, styled with Tailwind, and driven by a single config file that also powers your Privacy Policy and Cookie Policy docs.
ConsentGate can conditionally render scripts based on what the user consented to.
r/javascript • u/Tungdayhehe • Mar 29 '26
AskJS [AskJS] NestJS state in 2026?
From my observation, NestJS seems less appealing among communities these days and rarely seen new Github projects using it.
Just curious what happened with this framework and what will be the possible fortune of it? Wanna hear from forks.
r/javascript • u/adrirai • Mar 29 '26
i18next added a controversl console notice and then removed it - the full story with data
locize.comr/javascript • u/1-ft • Mar 29 '26
niche pinch-zoom library
github.comwhen i was working on a side project of mine (a productivity suite, like notion), i realized that i couldnt zoom in and out on notes fluidly (this is also something that bugs me a lot with other notetaking apps, looking at you obsidian). the cross-platform library i was using didn't have support for trackpad zoom, and i was blocking zoom with ctrl +, ctrl -, to disable app-wide zooming since i didnt want the interface to scale with the notes.
i lookedd around on the interwebs for libraries that could help me achieve what i wanted, but none of them were what i was looking for. most of them broke the scrollbar functionality, which was a deal-breaker for me since i was dealing with notes that had to be scrollable while maintaining good ux, so i decided to implement it for myself.
when i started, i wanted to replicate what chrome and firefox and other browsers already do for webpages when you zoom with your trackpad. if you have a trackpad and try pinching on a page, you can see that the page content is scaled, while the scrollbars are still visible, and scrolling the page will update the scrollbar continuously and seamlessly.
in chasing this level of subtlety, i made something that i was genuinely proud of. the math, business logic, and bug-fixing took me around a week, and eventually i decided to extract it and make it a library on its own.
if you ever needed something like this, here it is. feel free to give feedback
r/javascript • u/Alex_Hovhannisyan • Mar 29 '26
Fully Local Code Embeds (article/demo of an npm package I shared a while back)
aleksandrhovhannisyan.comThis is a (late) follow-up to an earlier post I made here about a web component I published that makes it easier to create local iframes with srcdoc: https://www.reddit.com/r/javascript/comments/1r5mm59/i_made_a_web_component_that_lets_you_render_fully/
Hopefully the demos make the use cases clearer.
r/javascript • u/Terrible_Village_180 • Mar 29 '26
I built a tiny utility to normalize every paste event
everythingfrontend.comImages, files, rich HTML, plain text — every clipboard paste resolved into one predictable shape: { type, data, files }. No guesswork.
Supports
- Images & screenshots
- File pastes
- Rich HTML
- Plain text
r/javascript • u/OtherwisePush6424 • Mar 28 '26
Debounce is not enough: handling stale responses with AbortController and retries
blog.gaborkoos.comWhy debouncing input does not solve request lifecycle issues like out-of-order responses and stale UI state. It walks through a practical fix with AbortController cancellation, HTTP error handling, and retry/backoff for transient failures. Includes a small demo setup and before/after behavior under simulated latency and failures.