Tags
#javascript
Blog posts, snippets, and glossary entries related to "javascript", gathered in one place.
- GlossaryBiome
Biome is a Rust-based formatter and linter for JavaScript and TypeScript that unifies code formatting and static analysis.
- SnippetsDynamic Import Caching
Lightweight TypeScript implementation for caching dynamic imports. Handle multiple imports to the same path with a single Promise.
- GlossaryLogTape
LogTape is a multi-runtime JavaScript logger library for Browser, Node.js, Deno, and Bun. It works with zero dependencies.
- Glossarymediabunny
mediabunny is a browser media library for video and audio handling built on the WebCodecs API.
- SnippetsMerging Uint8Arrays
A TypeScript function to merge multiple Uint8Arrays into one. Useful for combining binary data.
- Glossarynavigator.devicePosture
navigator.devicePosture is a Navigator property that exposes the DevicePosture object for posture-aware web interfaces.
- SnippetsSHA256 Synchronous Implementation (Without WebCrypto API)
A pure JavaScript SHA256 implementation without using the WebCrypto API. For environments where the crypto object is unavailable, such as some Web Workers implementations.
- SnippetsSplitting Text with TransformStream
A TypeScript example using ReadableStream and TransformStream to split long text into chunks of specified size.
- GlossaryTurndown
Turndown is a JavaScript library that converts HTML into Markdown with customizable conversion rules.
- SnippetsTypeScript Array Utilities
Collection of type-safe utility functions for common array operations in TypeScript development. Empty array generation, chunking, null filtering, and shuffling.
- GlossaryUint8Array
Uint8Array is a JavaScript TypedArray for 8-bit unsigned integers (0-255), commonly used in binary processing.
- SnippetsBuild-time Message ID Hash Store
A TypeScript function that hashes and shortens message IDs and contexts at build time. Useful when a target platform restricts allowed translation keys.
- SnippetsClone a Native UI Element to Inherit Styles
A lightweight pattern that maintains visual consistency by cloning existing host app buttons with cloneNode, then replacing only the icon and text. No need to fight obfuscated CSS.
- SnippetsEntity-Embedded Cooldown Warning Suppression
A pattern that embeds repeated warning suppression logic within the quota entity itself. Properly controls frequent warnings like rate limit notices and billing alerts.
- SnippetsIdempotent DOM Observer Setup via dataset
A simple pattern using data attributes to prevent duplicate MutationObserver registrations. No global registry needed, highly portable.
- SnippetsLayered DOM Observation Strategy
A pattern for progressively switching to narrower observers once the app is ready. Broadly reusable in SPA content scripts and third-party DOM integrations.
- SnippetsProperty Extractor Helper Function
Generate a function that extracts only specified properties from an object. Consolidate type-safe property extraction into one line for nested mapBy and array transformations.
- SnippetsWorker Pool with Sub-batches and Per-sub-batch Timeout
A pattern that splits large datasets into small sub-batches sent to workers, reducing memory pressure while setting timeouts per batch for early anomaly detection.
- SnippetsImage Extension Regex
JavaScript/TypeScript regex pattern to detect image formats from filenames. Supports png, webp, jpg, jpeg, avif, gif.
- SnippetsImplementing a Lightweight Result Type in TypeScript
An error handling pattern without try-catch. Type-safe error handling with a Result type that separates data and error.
- SnippetsLazy-Initialized Object
A TypeScript pattern using getters to generate values only on first access. Lightweight lazy evaluation compared to memory caching.
- SnippetsPolyfill for crypto.randomUUID
A polyfill implementation of the crypto.randomUUID function. While all browsers now support this, it serves as a useful reference for understanding how UUID v4 works.
- SnippetsTime-Based Semantic Version Generation
A TypeScript function that automatically generates version numbers from build timestamps. Useful when version limits exist, such as in Chrome extensions.
- SnippetsUint32Array Helper Functions
A concise TypeScript wrapper for `new Uint32Array` calls. Supports all constructor overloads with type-safe overload definitions.
- SnippetsUint8Array Helper Functions
A TypeScript wrapper to simplify new Uint8Array calls. Supports arrays, ArrayBuffers, and length-based initialization patterns.
- BlogUUID v7 implementation guide: Create with JavaScript, Go, and Shell
The bit structure of UUID v7, bit settings of version/variant, minimum implementation in JavaScript, Go, and Shell, check items during implementation, and RFC references are organized on one page. A practical guide that summarizes the points to check in the generation logic for developers who want to safely introduce IDs that are easy to sort in time series. It can be used for confirmation before implementation.
hsb.horse