Leveraging Web APIs for Portable JavaScript Libraries
summary
Built a Postgres client that runs on native web APIs using ArrayBuffer, TypedArray, DataView, TextEncoder/Decoder and Web Crypto, and it works across Node, Deno, Bun and browsers with tradeoffs. Highlights: Postgres client on native web APIs, array buffer slicing zero-copy and backpressure via web streams for pipeline composition. Benchmarks show 1.2× faster concat, 6× slower hex/base64 encoding, and webstreams 5× faster for one emit but 10–15× slower over 10k events. Missing native hex/B64 and buffer concat are practical limits.
AI-written summary · about
chapters (7)
- 0:00Introduction and context
- 2:19Why portable JavaScript libraries matter
- 5:30Working with binary data
- 13:10Streaming without Node streams
- 19:25Built-in crypto utilities
- 21:53Upcoming JavaScript features
- 25:41Call to action for developers
related talks
26mEvery Process, Everywhere, All at Once
39mWe Deserve a Better Streams API for the Web
14mStreaming the Web (it's not what you think)
40mJavascript and the Polyglot Web
40mIt's Not Just Node.js Anymore
23mIntroducing the New Web3.js
30mNative Speed on the Web: JavaScript and asm.js
32mAligning Node.js with the Web Platform
