Tags
#javascript
Content tagged with "javascript".
- SnippetsDynamic Import Caching
Lightweight TypeScript implementation for caching dynamic imports. Handle multiple imports to the same path with a single Promise.
- 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.
- SnippetsMerging Uint8Arrays
A TypeScript function to merge multiple Uint8Arrays into one. Useful for combining binary data.
- 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.
- 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.
- 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.
- SnippetsTypeScript Array Utilities
Collection of type-safe utility functions for common array operations in TypeScript development. Empty array generation, chunking, null filtering, and shuffling.
- 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.
- GlossaryBiome
Biome is a Rust-based formatter and linter for JavaScript and TypeScript that unifies code formatting and static analysis.
- Glossarynavigator.devicePosture
navigator.devicePosture is a Navigator property that exposes the DevicePosture object for posture-aware web interfaces.
- GlossaryTurndown
Turndown is a JavaScript library that converts HTML into Markdown with customizable conversion rules.
- GlossaryUint8Array
Uint8Array is a JavaScript TypedArray for 8-bit unsigned integers (0-255), commonly used in binary processing.
hsb.horse