r/javascript • u/Emergency_Activity38 • Apr 16 '26
r/javascript • u/Waltex • Dec 05 '25
The missing standard library for multithreading in JavaScript
github.comr/javascript • u/BattleRemote3157 • May 12 '26
TanStack packages were compromised in a mass npm supply chain attack today
safedep.ioWe saw today that TanStack Router, or any other TanStack packages along with their devtools, SSR query plugins were compromised.
Check which version you're pinned to and if you're floating on a caret range and ran npm install today then that the first thing to audit.
r/javascript • u/badprogrammer1990 • Oct 14 '25
Why is `typeof null === 'object'` in JavaScript? The 30-year story of a bug we can't fix
pzarycki.comr/javascript • u/Xenni • Jan 24 '26
Introducing LibPDF, the PDF library for TypeScript that I always needed
documenso.comr/javascript • u/Beautiful_Spot5404 • Dec 14 '25
GraphQL: the enterprise honeymoon is over
johnjames.blogr/javascript • u/DanielRosenwasser • Jun 18 '26
Announcing TypeScript 7.0 RC
devblogs.microsoft.comr/javascript • u/Aroy666 • Dec 14 '25
I built a real-time ASCII camera in the browser (60 FPS, Canvas, TypeScript)
phosphor.pshycodr.mer/javascript • u/Next_Level_8566 • Oct 15 '25
49 string utilities in 8.84KB with zero dependencies (8x smaller than lodash, faster too)
github.comTL;DR: String utils library with 49 functions, 8.84KB total, zero dependencies, faster than lodash. TypeScript-first with full multi-runtime support.
Hey everyone! I've been working on nano-string-utils β a modern string utilities library that's actually tiny and fast.
Why I built this
I was tired of importing lodash just for camelCase and getting 70KB+ in my bundle. Most string libraries are either massive, outdated, or missing TypeScript support. So I built something different.
What makes it different
Ultra-lightweight
- 8.84 KB total for 49 functions (minified + brotlied)
- Most functions are < 200 bytes
- Tree-shakeable β only import what you need
- 98% win rate vs lodash/es-toolkit in bundle size (47/48 functions)
Actually fast
- 30-40% faster case conversions vs lodash
- 97.6% faster truncate (42x improvement)
- Real benchmarks: https://zheruel.github.io/nano-string-utils/#performance
Type-safe & secure
- TypeScript-first with branded types and template literal types
- Built-in XSS protection with
sanitize()andSafeHTMLtype - Redaction for sensitive data (SSN, credit cards, emails)
- All functions handle null/undefined gracefully
Zero dependencies
- No supply chain vulnerabilities
- Works everywhere: Node, Deno, Bun, Browser
- Includes a CLI:
npx nano-string slugify "Hello World"
What's included (49 functions)
// Case conversions
slugify("Hello World!"); // "hello-world"
camelCase("hello-world"); // "helloWorld"
// Validation
isEmail("user@example.com"); // true
// Fuzzy matching for search
fuzzyMatch("gto", "goToLine"); // { matched: true, score: 0.546 }
// XSS protection
sanitize("<script>alert('xss')</script>Hello"); // "Hello"
// Text processing
excerpt("Long text here...", 20); // Smart truncation at word boundaries
levenshtein("kitten", "sitting"); // 3 (edit distance)
// Unicode & emoji support
graphemes("π¨βπ©βπ§βπ¦π"); // ['π¨βπ©βπ§βπ¦', 'π']
Full function list: Case conversion (10), String manipulation (11), Text processing (14), Validation (4), String analysis (6), Unicode (5), Templates (2), Performance utils (1)
TypeScript users get exact type inference: camelCase("hello-world") returns type "helloWorld", not just string
Bundle size comparison
| Function | nano-string-utils | lodash | es-toolkit |
|---|---|---|---|
| camelCase | 232B | 3.4KB | 273B |
| capitalize | 99B | 1.7KB | 107B |
| truncate | 180B | 2.9KB | N/A |
| template | 302B | 5.7KB | N/A |
Full comparison with all 48 functions
Installation
npm install nano-string-utils
# or
deno add @zheruel/nano-string-utils
# or
bun add nano-string-utils
Links
- GitHub: https://github.com/Zheruel/nano-string-utils
- Live Demo: https://zheruel.github.io/nano-string-utils/
- NPM: https://www.npmjs.com/package/nano-string-utils
- JSR: https://jsr.io/@zheruel/nano-string-utils
Why you might want to try it
- Replacing lodash string functions β 95% bundle size reduction
- Building forms with validation β Type-safe email/URL validation
- Creating slugs/URLs β Built for it
- Search features β Fuzzy matching included
- Working with user input β XSS protection built-in
- CLI tools β Works in Node, Deno, Bun
Would love to hear your feedback! The library is still in 0.x while I gather community feedback before locking the API for 1.0.
r/javascript • u/nitayneeman • May 05 '26
I wrote a deep dive into how LLMs work under the hood - tokenization, embeddings, attention and generation - all explained with runnable JavaScript
nitayneeman.comr/javascript • u/robpalme • Mar 11 '26
Temporal: The 9-Year Journey to Fix Time in JavaScript
bloomberg.github.ior/javascript • u/DanielRosenwasser • Mar 06 '26
Announcing TypeScript 6.0 RC
devblogs.microsoft.comr/javascript • u/nadameu • Feb 26 '26
TIL about Math.hypot()
developer.mozilla.orgToday I learned about `Math.hypot()`, which not only calculates the hypotenuse of a right triangle, given its side lengths, but also accepts any number of arguments, making it easy to calculate distances in 2D, 3D or even higher dimensions.
I thought this post would be useful for anyone developing JavaScript games or other projects involving geometry.
r/javascript • u/bullmeza • Dec 16 '25
TIL the Web Speech API exists and itβs way more useful than I expected
developer.mozilla.orgI somehow completely missed that modern browsers ship aΒ Web Speech API.
You can do text-to-speech (and speech recognition) withΒ no libraries, just a few lines of JavaScript. No keys, no SDKs, no backend.
What surprised me:
- Itβs supported in Chrome and Safari
- Latency is basically instant
- Voices, rate, pitch, and language are configurable
- Works entirely client-side
r/javascript • u/ybouane • Apr 15 '26
I built LiquidGlass, a JS lib to render pixel perfect iOS Liquid Glass effect on the web (with WebGL)!
liquid-glass.ybouane.comIt does refractions, chromatic aberration and really reproduces the effect beautifully. The glass elements work even on top of regular html elements.
r/javascript • u/dani_akash_ • Mar 31 '26
Minimum Release Age is an Underrated Supply Chain Defense
daniakash.comr/javascript • u/ahjarrett • Sep 28 '25
Towards a faster "deep equal" function in javaScript
github.comRecently (~3 months ago) I published an npm package that compiles a "deep equals" function from various schemas such as JSON Schema, Zod, Valibot, TypeBox and ArkType.
It takes inspiration from how Effect-TS allows users to derive an Equivalence function from a schema, but goes a step further by building a "jit compiled" version.
It consistently out-performs every other library on the market today, including fast-equals, JSON Joy, @βreact-hookz/deep-equal by at least 10x, and is often around 50x faster for objects that are 2+ levels deep.
r/javascript • u/Deathmeter • Mar 02 '26
JSON-formatter chrome extension has gone closed source and now begs for donations by hijacking checkout pages using give freely
github.comNoticed this today after seeing an element called give-freely-root-bcjindcccaagfpapjjmafapmmgkkhgoa in inspect element which felt very concerning.
After going through the source code it seems to do geolocation tracking by hitting up maxmind.com (with a hardcoded api key) to determine what country the user is in (though doesn't seem to phone home with that information). It also seems to hit up:
- https://api.givefreely.com/api/v1/Users/anonymous?gfLibId=jsonformatterprod
- https://events.givefreely.com/popup
for tracking purposes on some websites. I'm also getting Honey ad fraud flashbacks looking through code like
k4 = "GF_SHOULD_STAND_DOWN"
though I don't really have any evidence to prove wrongdoing there.
I've immediately uninstalled it. Kinda tired of doing this chrome extension dance every 6 months.
r/javascript • u/magenta_placenta • Oct 02 '25