r/javascript • u/cekrem • Jun 24 '26
r/javascript • u/myroslavmartsin • Jun 23 '26
csv-pipe: a small, zero-dependency CSV library for JavaScript and TypeScript
martsinlabs.github.ioI got tired of CSV exports breaking in production, so I built this. It reads and writes CSV from one small zero-dependency package, streams both directions at flat memory, and the same code runs on Node, browsers, Deno, Bun, and edge.
A few things that make it nice to use: - Encode and parse are mirror images, so a round-trip keeps its shape. - It hands back a Web ReadableStream, so a CSV download streams straight to the client without buffering. - A sanitizeFormulas flag neutralizes spreadsheet formula injection in exports. - On TypeScript, the column list is checked against your data, so a mistyped column is a compile error.
It also came out the fastest of the common parsers in my benchmark: roughly 3x to 13x faster than papaparse, csv-parse, and fast-csv on a 50k-row dataset. The benchmark and a conformance suite (a curated edge-case corpus, csv-spectrum, and fast-check property tests) run in CI, so the numbers and the correctness are reproducible, not claims.
To be clear about what is not unique: zero dependencies, a formula-injection guard, and browser support are shared with papaparse and csv-parse/csv-stringify. fast-csv is the one that lags there.
Repo: https://github.com/martsinlabs/csv-pipe Docs: https://martsinlabs.github.io/csv-pipe/ Playground: https://martsinlabs.github.io/csv-pipe/playground
r/javascript • u/Spatul8r • Jun 23 '26
AskJS [AskJS] I'm not a big fan of tuples here
I'm making a quick and dirty way to make dictionaries where many keys map to the same item, and instead of using a single hashable item as the key, it makes use of an array of hashable items to build the map. I don't like using tuples, but I don't think it would be valid to have an array as the key of a dictionary. I would love it if I could do that however. Is there a way to make a hashable array?
let map = MapFactory(
[
[[1,2,3], () => "1-3"],
[[4,5,6], () => "4-6"],
[[7,8,9], () => "7-9"]
]
);
console.log(map.get(1)()); // "1-3"
console.log(map.get(6)()); // "4-6"
function MapFactory(mapItems) {
const map = new Map();
for (let [keys, value] in mapItems) {
for(let key in keys) {
map.set(key, value);
}
}
return map;
}
r/javascript • u/rocketbeanstalk • Jun 23 '26
AskJS [AskJS] Cloud Storage library that works across Backend & browser
I got tired of rewriting my upload code every time a project switched buckets (or added "let users connect their Google Drive"). So I built a project: five portable ops that behave identically everywhere, swap providers by config.
import { createStorage } from "@rocketbean/genera";
import { S3Driver } from "@rocketbean/genera-s3";
const storage = createStorage(new S3Driver({ bucket, region, credentials }));
await storage.put("users/42/avatar.png", bytes);
// swap S3Driver โ GoogleDriveDriver and the rest of your code is unchanged
What I think makes it worth a look:
- Isomorphic โ core uses only web standards, so it runs in the browser too
- Escape hatch โ .native gives you the raw provider SDK any time; the abstraction never blocks you
- Typed capabilities โ signed URLs / streaming / copy are advertised per-driver, no silent surprises
- Conformance-tested โ every driver passes one shared suite (Node, real browser, live accounts)
- Dependency-light core; cloud SDKs are peer deps so you only install what you use
It's v1.0.0 and solo-maintained, so eyes/feedback very welcome.
this project is on it's early stage, feedback would really be appreciated
r/javascript • u/Ivandre • Jun 22 '26
I built a 3KB cookie-consent toolkit for React/Next.js that respects GPC/Do-Not-Track and won't break SSR hydration
github.comr/javascript • u/GulgPlayer • Jun 21 '26
33-byte JS signal implementation
gist.github.comRecently I've developed a code-golfed signal implementation with the following features/constraints:
- subscribes functions returning nullish values.
- fires all pending subscribers and resets.
- requires no arguments to be passed to the factory and either null/undefined or a function to the signal. (as noted by u/azhder)
As it turns out, you can go as short as 33 bytes using function compositon, nullish coalescing and default parameters:
F=>(f,G=F)=>F=f?_=>f(G?.()):F?.()
r/javascript • u/subredditsummarybot • Jun 22 '26
Subreddit Stats Your /r/javascript recap for the week of June 15 - June 21, 2026
Monday, June 15 - Sunday, June 21, 2026
Top Posts
Most Commented Posts
| score | comments | title & link |
|---|---|---|
| 0 | 15 comments | LoggerJS: A faster, more powerful isomorphic logger |
| 0 | 9 comments | My PostgreSQL query went from 57ms to 1.4ms on a 1 million + row table. I didn't change the query. Here's what I did. |
| 0 | 9 comments | There are too many JavaScript schema libraries, so support only one |
| 2 | 9 comments | [AskJS] [AskJS] Burned out on WordPress: Is transitioning to AstroJS + ApostropheCMS a smart move for a solo dev? |
| 3 | 8 comments | [Showoff Saturday] Showoff Saturday (June 20, 2026) |
Top Ask JS
| score | comments | title & link |
|---|---|---|
| 3 | 2 comments | [AskJS] [AskJS] I tried patching Vite and E2B to catch silent Node.js crashes. They rejected. So I built a non-invasive wrapper instead. |
| 0 | 1 comments | [AskJS] [AskJS] what 'turn X into a podcast' workflows are people actually running |
| 0 | 7 comments | [AskJS] [AskJS] How much do you hate this pattern? |
Top Showoffs
Top Comments
r/javascript • u/Rechenplaner • Jun 21 '26
Factories.ts: Build HTML/SVG/MathML with plain TypeScript functions, no template engine
github.comFactories.ts is a lightweight DSL for generating markup directly in JavaScript/TypeScript. Elements are ordinary functions you nest together, so the full structure is built with regular JS/TS, including loops, conditionals, and type checking, instead of a separate template language:
import { ul, li } from "@ts-series/factories"
const items = [
{ name: "Coffee", inStock: true },
{ name: "Tea", inStock: false },
];
const list = ul(
...items.map(item =>
li(item.name, item.inStock ? null : " (sold out)")
.class(item.inStock ? "available" : "unavailable")
)
);
console.log(list.expand());
The functions, referred to here as "factories", return element objects that store their content as plain arrays. This makes the approach highly efficient and, unlike JSX, requires no separate build process.
Works in Deno and Node.
r/javascript • u/Several-Specialist42 • Jun 21 '26
A benchmark focusing on the performance of Postgres client libraries for Node.js, brianc/node-postgres VS porsager/postgres
github.comr/javascript • u/TrustSig • Jun 21 '26
We assume attackers have fully deobfuscated our JS bundle and design the detection around that
trustsig.eur/javascript • u/fagnerbrack • Jun 20 '26
Incorporate monads and category theory ยท Issue #94 ยท promises-aplus/promises-spec
github.comr/javascript • u/fagnerbrack • Jun 20 '26
Parse, Don't Validate โ In a Language That Doesn't Want You To
cekrem.github.ior/javascript • u/AutoModerator • Jun 20 '26
Showoff Saturday Showoff Saturday (June 20, 2026)
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/fagnerbrack • Jun 19 '26
Signals, the push-pull based algorithm
willybrauner.comr/javascript • u/hitechboatman • Jun 19 '26
bote: Fast, low-memory streaming JSON parser. Can process MB/GBs of JSON by up to 16x less memory than JSON.parse() whilst being 1.5x faster. FOSS
github.com- Modernย
AsyncIteratorย API - Integrates withย Standard Schema
- Allows you to navigate to any parts of JSON, without considering order of appearance in a stream
- Structural (e.g. {}[]) position bitmap construction, caching and navigation, written in Rust
Benchmarks are in the README.md.
Hey folks. wrote this library to satisfy an itch for me: To make an ergonomic streaming JSON library whilst still being incredibly fast.
I took lessons from simdjson and JSONSki and applied it to a low-memory environment niche. Inspired from a situation at work where we didn't have control over the data and we're parsing a 10MB JSON in order to aggregate some data to the frontend (ugh). Existing streaming JSON libraries in node were too slow, outdated or you weren't able to control how much memory you want to balance.
Disclaimer: I had AI help but not vibe coded. I wrote the JS part but since I was new to Rust, I needed some hand-holding. Was a labour of love for 6 months, was always on the wheel, made a lot of effort to verify the quality of the Rust code and dogfooded it but I wanted to be transparent regardless.
If this is useful to anyone or if there's anything wrong to my claim, let me know and I'm happy to chat!
r/javascript • u/Prior-Caramel-8351 • Jun 19 '26
Open source JS browser interfaces for hacked POS terminals used as live instruments
vlasvlasvlas.github.ioOpen source browser interfaces for hacked POS terminals used as live instrument
r/javascript • u/DanielRosenwasser • Jun 18 '26
Announcing TypeScript 7.0 RC
devblogs.microsoft.comr/javascript • u/Ankit9673 • Jun 20 '26
Nifra - The full stack framework for AI
github.comr/javascript • u/jadjoubran02 • Jun 18 '26
Declarative Partial Updates unlock a new Native Component Model
jadjoubran.ior/javascript • u/jxd-dev • Jun 18 '26
How we built meetings on LiveKit and Deepgram
plain.jxd.devFollowing on from our last post showing how we built realtime features into Plain, we're back with another complex feature we shipped recently: meetings.
This is another step toward being the best place for technical and non-technical team members to work together without the burden of context switching.
Hope this look into our LiveKit and Deepgram infrastructure is interesting and useful. It goes to show you don't need $100m in funding to build complex features.
r/javascript • u/Martinsos • Jun 17 '26
Wasp framework now lets you write your "full-stack" logic, next to frontend and backend logic, as a spec in TypeScript
wasp.shHey all, Martin here, creator of Wasp here!
Wasp is a batteries-included full-stack framework for JS/TS (React, Node), analogous to Ruby on Rails, Laravel, Django, etc.
It has a special property though: a dedicated logic layer, called โspecโ, for writing โfull-stackโ logic, a place where you describe your app at a high level that connects frontend, backend, and database, all together, giving you a central place to โreasonโ about your web app.
So far, we had the โspecโ implemented in a custom language (.wasp), but now we switched to TypeScript (.wasp.ts), unlocking more advanced usage and many cool future ideas to build on top of it (extensibility, full-stack modules (think Ruby on Rails Engines)).
Itโs simple in its essence, in e.g. main.wasp.ts you import โspec constructorsโ (app, page, route, api , etc) and then use those to construct a spec object, while also being able to reference your React and Node code.
import { app, page, query, route } from "@wasp.sh/spec";
import { MainPage } from "./src/MainPage.tsx" with { type: "ref" };
import { getTasks } from "./src/tasks.ts" with { type: "ref" };
export default app({
wasp: { version: "^0.24.0" },
title: "ToDo App",
auth: {
userEntity: "User",
methods: { google: {}, gitHub: {}, email: {} },
},
spec: [
route("RootRoute", "/", page(MainPage, {
authRequired: true
})),
query(getTasks, {
entities: ["Task"]
})
]
});
I go in much more detail in the attached article I wrote: motivation, what this enables, examples, etc.
Would love any feedback! Does this sound interesting, is it making sense, can I explain something better? Something else that you would like to see from a full-stack framework? Thanks!
r/javascript • u/cryptomallu123 • Jun 18 '26
My PostgreSQL query went from 57ms to 1.4ms on a 1 million + row table. I didn't change the query. Here's what I did.
sharafath.hashnode.devr/javascript • u/supersnorkel • Jun 17 '26
Prefetch based on mouse trajectory. ForesightJS v4.0 is out with official React & Vue packages
foresightjs.comHey all, a while back I shared ForesightJS, the library that predicts user intent from mouse trajectory (and keyboard tab navigation) so you can prefetch before a hover or click actually happens. Just shipped v4.0 and the big focus was making it way less annoying to use with frameworks.
Before, the docs basically handed you premade hooks/composables/directives to copy-paste into your project. That always felt janky. v4 replaces all of it with two real packages:
Also we just hit 1550+ stars on github!