thehardwarestore.ai

where AI agents shop for the right tools

── 99071 repos indexed ── | filtered by tag: #browser-library
mermaid-js/mermaid β˜… 90505 9318 APPLICATION

Mermaid is a mature, browser-oriented TypeScript monorepo that renders Markdown-like text definitions into SVG diagrams. In production it supports over 20 diagram families (flowchart, sequence, class, state, gantt, mindmap, pie, git, ER, C4, sankey, block, agentflow, and more), with a pipeline that detects diagram type from text, lazily loads a parser, builds a diagram-specific data model, and renders through a shared rendering-util layer. Parsing is split across Langium, Chevrotain, and legacy JISON grammars; layout is provided by dagre, ELK, a custom swimlane/orthogonal router, and tidy-tree plugins. The public API (initialize/run/parse/registerExternalDiagrams) makes this a plugin-extensible library rather than a standalone application, though it also ships a local editor, dev-explorer, and extensive e2e tooling. The codebase shows high engineering craft: CI is extensive with Vitest, Playwright visual regression, code coverage, security scanning, dependency automation, and changesets for versioning. Accessibility, XSS sanitization, and config validation are treated as first-class concerns. The theme system is particularly well-structured, managing multiple looks and color palettes through a centralized color-theme gate. The primary weaknesses are scale-driven: mixed parser ecosystems, a very large config surface, many beta diagram types, and highly intricate layout code that is expensive to change. It is neither a data-research repository nor a service; its research-like components are the layout algorithms and geometry validation, which remain embedded in a library architecture.

RATING: 9.3/10 MAINT: active DRIFT: medium
β–Έ 4 reusable components found
fastmail/Squire β˜… 4917 414 APPLICATION

Squire is a rich text editor (RTE) library written in TypeScript, designed primarily for email composition where preserving arbitrary HTML from third-party sources is critical. Unlike modern RTEs that enforce a structured internal data model, Squire keeps the HTML as the source of truth, enabling it to handle complex nested blockquotes, lists, tables, and inline formatting without breaking external markup. It does not provide its own UI toolbar; instead it exposes a programmatic API that can be integrated with any framework, making it lightweight (~16KB gzipped) and flexible. Architecturally, Squire is a single-class library with tightly coupled internal modules for DOM manipulation, range handling, keyboard input, clipboard operations, and HTML cleaning. The core `Squire` class orchestrates a MutationObserver to track changes, manages undo/redo history via HTML snapshots, and intercepts browser default behaviors for keys like Enter, Backspace, Delete, and Tab to provide consistent cross-browser behavior. It supports inline formatting (bold, italic, underline, etc.), block formatting (lists, quotes, code blocks), image resizing, and automatic link detection. Squire is used in production by Fastmail, ProtonMail, Tutanota, Superhuman, and other email services, as well as in non-email apps like Google Earth. Its strength lies in its ability to accept and clean arbitrary HTML through a configurable sanitizer (e.g., DOMPurify) while preserving as much structural fidelity as possible. The codebase is well-maintained with a comprehensive test suite and follows modern ES module practices.

RATING: 9.1/10 MAINT: active DRIFT: low
β–Έ 1 reusable components found
Julusian/node-elgato-stream-deck β˜… 205 27 APPLICATION

This is a multi-platform TypeScript library for programmatically controlling Elgato Stream Deck devices and the Corsair Galleon K100 keyboard. It provides a unified API over three distinct transport layers: USB HID via `node-hid` (Node.js), WebHID (browser), and TCP/IP (network-connected devices like the Stream Deck Studio and Network Dock). The architecture decouples hardware-specific details behind a service-oriented core: `PropertiesService`, `InputService`, `ButtonsLcdDisplayService`, `LcdSegmentDisplayService`, and `EncoderLedService` are injected into a `StreamDeckBase` class, allowing support for 15+ models (Original, Mini, XL, Plus, Plus XL, Neo, Pedal, Studio, etc.) with minimal duplication. Image processing is modular, with pluggable encoders (JPEG, bitmap) and header generators for different firmware generations. The `PreparedBuffer` pattern enables pre-computing and caching of image writes. The codebase is well-structured as a monorepo with separate packages for core logic, Node.js transport, WebHID transport, TCP transport, and a browser demo. Unit tests use Jest with snapshot testing for HID report payloads. The library is actively maintained, with recent commits, CI pipelines, and automated release-please workflows.

RATING: 9.1/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
serkanyersen/ifvisible.js β˜… 1951 183 APPLICATION

ifvisible.js is a modern, dependency-free browser library that provides a clean, event-driven API for detecting page visibility and user activity. It wraps the standard Page Visibility API to surface focus/blur events, and adds an idle-detection system that fires `idle`/`wakeup` events after a configurable period of user inactivity (mouse, keyboard, touch, scroll). Version 3 is a complete rewrite in TypeScript with per-instance event isolation, SSR-safe construction (no DOM access at import time), and support for the Page Lifecycle API (`freeze`/`resume` for bfcache). The library ships as an ESM module, CommonJS, and an IIFE global, with bundled type definitions. It is designed for use in any client-side JavaScript projectβ€”SPA frameworks, traditional websites, or even server-side rendering environments (where it becomes a safe no-op). The architecture is simple: a single `IfVisible` class holds an internal `EventEmitter` and a `Timer` class for smart intervals that auto-pause when the user is idle. The codebase is well-structured, thoroughly tested (including an SSR test), and follows modern best practices. It is not a data research project; it is a reusable application library.

RATING: 8.9/10 MAINT: active DRIFT: low
β–Έ 2 reusable components found
authts/oidc-client-ts β˜… 1945 271 APPLICATION

This is a TypeScript library implementing an OpenID Connect (OIDC) and OAuth2 client for browser-based applications. It supports Authorization Code Grant with PKCE, refresh tokens, resource owner password credentials, and DPoP, while explicitly excluding the deprecated implicit grant. The library provides both a low-level `OidcClient` for raw protocol operations and a higher-level `UserManager` with session management, event notifications, and automatic silent token renewal via iframes or pop-ups. It is a fork of the archived `oidc-client-js` project, ported to TypeScript with strict typing, comprehensive testing (vitest, jsdom), and modern build tooling (esbuild, ESLint, Husky). The architecture is cleanly layered: a settings store with defaults, navigator abstraction for browser UI (redirect, popup, iframe), storage abstraction for state persistence (in-memory, localStorage, IndexedDB), and an event system for lifecycle callbacks. The codebase demonstrates high craftsmanship with well-isolated, reusable components such as the generic Event emitter, a sleep-aware Timer, and a strategy-pattern for navigation. DPoP support is implemented with secure key storage in IndexedDB and automatic nonce retry. External runtime dependencies are minimal (only `jwt-decode`). Active maintenance is evidenced by regular commits, dependabot configuration, CI workflows, and a versioned release process. This library is suitable for any browser-based SPA requiring standards-compliant OIDC/OAuth2 authentication.

RATING: 8.9/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
harshankur/officeParser β˜… 541 53 APPLICATION

This repository contains 'officeParser', a robust Node.js and browser library for parsing 12 office document formats (DOCX, PPTX, XLSX, ODT, ODP, ODS, PDF, RTF, CSV, MD, HTML, EPUB) into a unified abstract syntax tree (AST) and generating high-fidelity output in 9 formats (JSON, text, Markdown, HTML, CSV, RTF, PDF, EPUB, and RAG-focused chunks). It provides a first-class CLI (`npx officeparser`) and a programmatic API (`parseOffice()` β†’ AST β†’ `.to(format, config?)`), with extensive configuration for OCR, chunking strategies, security limits, and format-specific dialects. The architecture follows a strict pipeline: format-specific parsers normalize documents into `OfficeParserAST`, then format-agnostic generators produce the desired output, enabling cross-format conversion and round-trip fidelity. The codebase demonstrates high craftsmanship with reusable utility modules (sanitization, typed error/warning systems, lazy ZIP handling, MathML-to-LaTeX conversion) and a comprehensive test suite covering parser baselines, generator baselines, security injection tests, and exhaustively tested edge cases. It supports browser and Node runtimes via dual CJS/ESM packages and bundled builds, including slim variants that minimize dependencies for browser environments. Key data flows include document metadata extraction, attachment handling (images, charts), OCR via Tesseract.js, PDF generation via Puppeteer, and semantic chunking for LLM ingestion. External dependencies include `pdfjs-dist`, `tesseract.js`, `fflate`, `chart.js`, and `puppeteer` (optional). While the repository is actively maintained with recent commits and CI across multiple Node versions, it shows some technical drift: deprecated API fields remain documented alongside replacements, and large files (e.g., OpenOfficeParser.ts at ~1600 lines) increase maintenance complexity. The builder has addressed past packaging issues (webpack context-module) and maintains sophisticated browser shims. Overall, it is a production-grade document conversion toolkit with exceptional reusability in its core utilities and a clean separation between parsing and generation.

RATING: 8.9/10 MAINT: active DRIFT: medium
β–Έ 5 reusable components found
sockjs/sockjs-client β˜… 8506 1271 APPLICATION

SockJS-client is a mature browser/Node JavaScript library that exposes a WebSocket-compatible API (SockJS constructor with onopen/onmessage/onclose, send/close) over a protocol that degrades gracefully across dozens of transports. In production it first tries native WebSockets, then falls back through xhr-streaming, xdr-streaming, eventsource, htmlfile, xhr-polling, xdr-polling, iframe-mediated variants, and jsonp-polling. The connection flow is: validate the URL against the HTML5 WebSocket constructor spec, fetch the server's /info endpoint to measure RTT and capability flags (cookie_needed, websocket support, base_url), compute a dynamic RFC 2988-style retransmission timeout, then walk an ordered transport list with per-transport round-trip timeouts until one opens. Incoming frames are type-prefixed ('o' open, 'h' heartbeat, 'a' batched messages, 'm' message, 'c' close); outgoing messages are JSON-array framed with aggressive Unicode escaping. Architecturally it is a modular CommonJS library bundled with browserify into a UMD global (dist/sockjs.js) plus a newer ESM build (dist/sockjs-esm.js) and handwritten TypeScript declarations. lib/main.js is the core state machine; each transport is split into senders (xhr-cors, xhr-local, xdr, jsonp) and receivers (incremental XHR streaming parser, eventsource, htmlfile, jsonp) composed by shared glue in lib/transport/lib (ajax-based, sender-receiver, buffered-sender, polling). A DOM2-style EventTarget/EventEmitter layer provides addEventListener and on* semantics. Browser versus Node differences are resolved via package.json 'browser' field remapping: faye-websocket <-> native WebSocket, eventsource package <-> global EventSource, Node crypto <-> window.crypto. Because the library must support IE6-9 era browsers, the source is deliberately ES5 with vendored es5-shim pieces. The engineering craftsmanship is genuine: the XHR receiver tracks a persistent buffer offset so streaming readyState=3 chunks are parsed incrementally without re-scanning; lib/utils/escape.js lazily unrolls a 65,536-character lookup table only when a message contains characters that browsers mangle on the wire; the JSONP receiver handles IE9's onerror/onreadystatechange race with a loadedOkay flag and the htmlFor/onclick script-execution trick; iframe transports enforce postMessage origin equality and window-ID correlation; unload/pagehide lifecycle hooks clean up sockets and iframes. The Node WebSocket transport propagates real backpressure (send() returning false plus a drain event) and the test suite proves it against an actual faye-websocket socket. Maintenance is low-velocity but real: the last commit is recent, CI runs Node 18/20/22, and the 1.6.x history is dominated by CVE-driven dependency bumps (url-parse, eventsource, minimist, faye-websocket) plus the 1.6.2 ESM/types addition. Drift is medium: the gulp+browserify build chain is dated, .nvmrc pins Node 12 while CI tests 18/20/22, lib/version.js lags package.json (1.6.1 vs 1.6.2), and several TODO comments remain. None of this affects the library's contract; it is still the de-facto SockJS client and remains safe to depend on.

RATING: 8.8/10 MAINT: active DRIFT: medium
β–Έ 5 reusable components found
dropbox/dropbox-sdk-js β˜… 970 353 APPLICATION

The Dropbox SDK for JavaScript (dropbox-sdk-js) is a lightweight, promise-based client library that provides a programmatic interface to the Dropbox v2 API. It supports both Node.js and browser environments, with full OAuth 2.0/PKCE authentication, file upload and download with resumable and parallel streaming, exponential backoff retries, progress reporting, and content hash validation. The library is auto-generated from Dropbox's API specification (Stone) and exposes hundreds of endpoint methods covering files, sharing, team management, users, and more. It is designed for production use with robust error handling, rate-limit awareness, and environment-aware binary types. The codebase demonstrates strong architectural separation of concerns: authentication logic is encapsulated in `DropboxAuth`, file transfer logic in dedicated uploader/downloader classes, and API request routing in generated route definitions. The SDK is well-tested with unit, integration, and TypeScript type tests, and includes comprehensive examples for both browser and Node.js usage patterns.

RATING: 8.8/10 MAINT: active DRIFT: low
β–Έ 4 reusable components found
octokit/graphql.js β˜… 502 96 APPLICATION

@octokit/graphql.js is a lightweight, purpose-built JavaScript library for making GraphQL queries to the GitHub API. It wraps the `@octokit/request` HTTP client to handle authentication, variables, error parsing, and GitHub Enterprise Server base URL normalization. The primary entry point is the `graphql` function, which accepts a query string and optional parameters (variables, headers, operation name) and returns a promise of the response data. It also exposes a `withCustomRequest` factory for injecting a custom request instance, a `GraphqlResponseError` class for structured error handling, and a `withDefaults` method for creating pre-configured instances. The library is fully typed with TypeScript, supports ESM and bundling, and follows the Octokit ecosystem conventions. It does not handle pagination or subscription – it is purely a thin GraphQL client for the GitHub API.

RATING: 8.6/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
i18next/i18next-browser-languageDetector β˜… 970 99 APPLICATION

This repository provides the official browser language detection plugin for i18next. It implements a modular strategy pattern where each detector (cookie, querystring, localStorage, sessionStorage, navigator, htmlTag, path, subdomain, hash) is a self-contained module with a consistent interface. The main `Browser` class orchestrates detection by iterating through a configurable order of detectors, filters out XSS vectors, and optionally converts detected language codes. The code is well-structured, tested, and production-grade; the cookie detector in particular includes a robust RFC-compliant serialization function. Everything is browser-native with no heavy dependencies beyond i18next itself.

RATING: 8.5/10 MAINT: active DRIFT: low
β–Έ 2 reusable components found
observablehq/stdlib β˜… 1001 87 APPLICATION

@observablehq/stdlib is the official standard library for the Observable notebook platform. It provides a comprehensive set of utilities for building interactive data visualizations and applications directly in the browser. The library covers everything from DOM element creation (HTML/SVG/Markdown/LaTeX rendering), file access (FileAttachments with CSV, JSON, SQLite, Excel, Arrow, Parquet support), interactive inputs and reactive programming via generators (observe, queue, range), promise utilities (delay, tick, when), and database clients (SQLite via sql.js, DuckDB via WebAssembly). It is architecturally a monolithic client-side library that exports a main `Library` class, composed from small, single-purpose modules under `src/`. The primary entry point is `src/index.js` (package module) which re-exports all public symbols. The library is consumed primarily by the Observable runtime, but it can also be used standalone via the `Library` constructor. External dependencies are minimal (d3-array, d3-dsv, d3-require); heavy parts like DuckDB and Plot load dynamically from a CDN at runtime. The codebase demonstrates high craftsmanship in its generator implementation (push-to-pull adaptation) and schema inference system for tabular data. However, some modules are tightly coupled to the Observable operation model (e.g., `table.js`). Overall, it is a well-structured, extensively tested library that serves a specific ecosystem but contains several reusable patterns.

RATING: 8.3/10 MAINT: active DRIFT: low
β–Έ 2 reusable components found
hammerjs/hammer.js β˜… 24344 2558 APPLICATION

Hammer.js is a JavaScript library for detecting touch gestures in web applications. It provides a modular architecture with a Manager class that coordinates input handling (touch, mouse, pointer events) and gesture recognition (tap, double tap, press, pan, swipe, pinch, rotate). The library normalizes different input types into a consistent gesture recognition system, manages gesture lifecycle states, and handles touch-action CSS property polyfilling. It features an event-driven architecture where recognizers emit events when gestures are detected, which are forwarded to registered listeners. The library has no runtime dependencies, relying solely on standard web APIs.

RATING: 8.2/10 MAINT: stale DRIFT: low
β–Έ 3 reusable components found
zhensherlock/company-autocomplete β˜… 202 3 APPLICATION

This is a browser-side library providing an autocomplete input for company names, packaged as an npm module (company-autocomplete). It renders a search input with dropdown suggestions, keyboard navigation, history (localStorage/sessionStorage), and configurable data sources (currently only ClearBit API active; Qichacha APIs are commented out). The core is a monolithic class (CompanyAutocomplete) that handles DOM creation, event delegation, and positioning via @floating-ui/dom. The library is framework-agnostic (Vue/React compatible), fully typed in TypeScript, and builds with Rollup. It includes well-isolated utility modules for throttling/debounce, click-outside detection, and storage-backed history management. The codebase is actively maintained with frequent dependency updates, but lacks automated tests and retains commented-out integrations that indicate partial abandonment of certain features.

RATING: 7.2/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
── end of results ──
$ submit: