{"id":48837762,"url":"https://github.com/marcstraube/zappzarapp-node-browser-utils","last_synced_at":"2026-04-15T00:05:21.514Z","repository":{"id":338099179,"uuid":"1156612846","full_name":"marcstraube/zappzarapp-node-browser-utils","owner":"marcstraube","description":"TypeScript browser utility library — modular, type-safe, zero-dependency helpers for storage, cookies, events, encryption, and more","archived":false,"fork":false,"pushed_at":"2026-04-10T21:20:33.000Z","size":920,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-10T21:33:28.433Z","etag":null,"topics":["browser","cookies","dom","encryption","events","modular","storage","tree-shakeable","type-safe","typescript","utilities","validation","web-api","zero-dependency"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcstraube.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T21:09:22.000Z","updated_at":"2026-04-10T21:11:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marcstraube/zappzarapp-node-browser-utils","commit_stats":null,"previous_names":["marcstraube/zappzarapp-browser-utils","marcstraube/zappzarapp-node-browser-utils"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/marcstraube/zappzarapp-node-browser-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcstraube%2Fzappzarapp-node-browser-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcstraube%2Fzappzarapp-node-browser-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcstraube%2Fzappzarapp-node-browser-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcstraube%2Fzappzarapp-node-browser-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcstraube","download_url":"https://codeload.github.com/marcstraube/zappzarapp-node-browser-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcstraube%2Fzappzarapp-node-browser-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31820370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","cookies","dom","encryption","events","modular","storage","tree-shakeable","type-safe","typescript","utilities","validation","web-api","zero-dependency"],"created_at":"2026-04-15T00:05:20.293Z","updated_at":"2026-04-15T00:05:21.416Z","avatar_url":"https://github.com/marcstraube.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ @zappzarapp/browser-utils\n\n[![npm version](https://img.shields.io/npm/v/@zappzarapp/browser-utils.svg)](https://www.npmjs.com/package/@zappzarapp/browser-utils)\n[![Node.js Version](https://img.shields.io/node/v/@zappzarapp/browser-utils.svg)](https://www.npmjs.com/package/@zappzarapp/browser-utils)\n[![License](https://img.shields.io/npm/l/@zappzarapp/browser-utils.svg)](https://www.npmjs.com/package/@zappzarapp/browser-utils)\n[![CI](https://github.com/marcstraube/zappzarapp-node-browser-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/marcstraube/zappzarapp-node-browser-utils/actions/workflows/ci.yml)\n\nZero-dependency browser utilities with security-first design — type-safe,\ntree-shakeable, and fully tested.\n\n## Highlights\n\n- **All-in-one** — 35 browser modules in a single, tree-shakeable package\n- **Type-safe** — strict TypeScript with generics throughout\n- **Zero dependencies** — no runtime dependencies\n- **Secure by default** — cryptographic randomness, input validation, XSS\n  prevention\n- **Dual error handling** — throwing and Result-based APIs\n- **Quality-backed** — 3950+ tests, strict ESLint, full coverage\n\n## Modules\n\n### Storage \u0026 Data\n\n| Module     | Key Classes             | Description                       |\n| ---------- | ----------------------- | --------------------------------- |\n| storage    | `StorageManager`        | localStorage with LRU eviction    |\n| session    | `SessionStorageManager` | sessionStorage wrapper            |\n| cookie     | `CookieManager`         | Secure cookie management          |\n| indexeddb  | `IndexedDBManager`      | IndexedDB async wrapper           |\n| cache      | `CacheManager`          | HTTP-style stale-while-revalidate |\n| encryption | `EncryptedStorage`      | AES-GCM with PBKDF2               |\n\n### DOM \u0026 UI\n\n| Module     | Key Classes                       | Description                  |\n| ---------- | --------------------------------- | ---------------------------- |\n| html       | `DomHelper`, `HtmlEscaper`        | DOM helpers, HTML escaping   |\n| focus      | `FocusTrap`                       | Focus trapping for modals    |\n| scroll     | `ScrollManager`                   | Scroll utilities and locking |\n| fullscreen | `FullscreenManager`               | Fullscreen API wrapper       |\n| form       | `FormValidator`, `FormSerializer` | Validation and serialization |\n\n### Events \u0026 Input\n\n| Module   | Key Classes                              | Description                 |\n| -------- | ---------------------------------------- | --------------------------- |\n| events   | `EventDelegator`, `debounce`, `throttle` | Event delegation and timing |\n| keyboard | `ShortcutManager`                        | Keyboard shortcuts          |\n| idle     | `IdleCallback`                           | requestIdleCallback wrapper |\n\n### Observers\n\n| Module  | Key Classes                                            | Description                    |\n| ------- | ------------------------------------------------------ | ------------------------------ |\n| observe | `IntersectionObserverWrapper`, `ResizeObserverWrapper` | Intersection, Resize, Mutation |\n\n### Network \u0026 Communication\n\n| Module    | Key Classes                   | Description                   |\n| --------- | ----------------------------- | ----------------------------- |\n| network   | `RetryQueue`, `NetworkStatus` | Retry queue with backoff      |\n| offline   | `OfflineQueue`                | IndexedDB-backed offline sync |\n| websocket | `WebSocketManager`            | WebSocket with auto-reconnect |\n| request   | `RequestInterceptor`          | Fetch middleware and auth     |\n| url       | `UrlBuilder`                  | URL building, query params    |\n| broadcast | `BroadcastManager`            | Cross-tab messaging           |\n\n### Device \u0026 Environment\n\n| Module      | Key Classes          | Description                |\n| ----------- | -------------------- | -------------------------- |\n| device      | `DeviceInfo`         | Device detection           |\n| features    | `FeatureDetect`      | Browser feature detection  |\n| media       | `MediaQuery`         | Media queries, breakpoints |\n| visibility  | `VisibilityManager`  | Page Visibility API        |\n| geolocation | `GeolocationManager` | Geolocation API wrapper    |\n| performance | `PerformanceMonitor` | Core Web Vitals monitoring |\n\n### Security\n\n| Module    | Key Classes        | Description               |\n| --------- | ------------------ | ------------------------- |\n| csp       | `CspDetector`      | CSP detection and helpers |\n| sanitize  | `HtmlSanitizer`    | HTML sanitization         |\n| clipboard | `ClipboardManager` | Secure clipboard access   |\n\n### Utility\n\n| Module       | Key Classes                              | Description                 |\n| ------------ | ---------------------------------------- | --------------------------- |\n| logging      | `Logger`                                 | Console logging with levels |\n| notification | `NotificationManager`                    | Browser notifications       |\n| download     | `FileDownload`                           | File download triggers      |\n| a11y         | `AriaUtils`, `LiveAnnouncer`, `SkipLink` | Accessibility utilities     |\n| core         | `Result`, `Validator`, `debounce`        | Types, errors, validation   |\n\n## Requirements\n\n- **Node.js** \u003e= 20\n- **ESM-only** — cannot be `require()`'d from CommonJS\n\n## Installation\n\n```bash\nnpm install @zappzarapp/browser-utils\n# or\npnpm add @zappzarapp/browser-utils\n```\n\n## Quick Start\n\n### Storage Manager\n\n```typescript\nimport { StorageManager } from '@zappzarapp/browser-utils/storage';\n\ninterface UserData {\n  id: string;\n  name: string;\n}\n\nconst storage = StorageManager.create\u003cUserData\u003e({\n  prefix: 'myApp',\n  maxEntries: 100,\n});\n\nstorage.set('user-1', { id: '1', name: 'Alice' });\nconst user = storage.get('user-1');\n```\n\n### Keyboard Shortcuts\n\n```typescript\nimport { ShortcutManager } from '@zappzarapp/browser-utils/keyboard';\n\nconst shortcuts = ShortcutManager.create();\n\nshortcuts.register({\n  key: 's',\n  ctrlKey: true,\n  handler: () =\u003e saveDocument(),\n});\n\nshortcuts.destroy();\n```\n\n### Network Retry Queue\n\n```typescript\nimport { RetryQueue } from '@zappzarapp/browser-utils/network';\n\nconst queue = RetryQueue.create({\n  maxRetries: 3,\n  backoffStrategy: 'exponential',\n  networkAware: true,\n});\n\nconst result = await queue.add({\n  operation: () =\u003e fetch('/api/data').then((r) =\u003e r.json()),\n});\n```\n\n### Lazy Loading with Observers\n\n```typescript\nimport { IntersectionObserverWrapper } from '@zappzarapp/browser-utils/observe';\n\nconst cleanup = IntersectionObserverWrapper.lazyLoad(\n  document.querySelectorAll('img[data-src]'),\n  (img) =\u003e {\n    img.src = img.dataset.src!;\n  }\n);\n```\n\n## Documentation\n\n| Module                                      | Module                                        |\n| ------------------------------------------- | --------------------------------------------- |\n| [a11y](documentation/a11y.md)               | [keyboard](documentation/keyboard.md)         |\n| [broadcast](documentation/broadcast.md)     | [logging](documentation/logging.md)           |\n| [cache](documentation/cache.md)             | [media](documentation/media.md)               |\n| [clipboard](documentation/clipboard.md)     | [network](documentation/network.md)           |\n| [cookie](documentation/cookie.md)           | [notification](documentation/notification.md) |\n| [core](documentation/core.md)               | [observe](documentation/observe.md)           |\n| [csp](documentation/csp.md)                 | [offline](documentation/offline.md)           |\n| [device](documentation/device.md)           | [performance](documentation/performance.md)   |\n| [download](documentation/download.md)       | [request](documentation/request.md)           |\n| [encryption](documentation/encryption.md)   | [sanitize](documentation/sanitize.md)         |\n| [events](documentation/events.md)           | [scroll](documentation/scroll.md)             |\n| [features](documentation/features.md)       | [session](documentation/session.md)           |\n| [focus](documentation/focus.md)             | [storage](documentation/storage.md)           |\n| [form](documentation/form.md)               | [url](documentation/url.md)                   |\n| [fullscreen](documentation/fullscreen.md)   | [visibility](documentation/visibility.md)     |\n| [geolocation](documentation/geolocation.md) | [websocket](documentation/websocket.md)       |\n| [idle](documentation/idle.md)               | [glossary](documentation/glossary.md)         |\n\n**Guides:** [Browser Support](documentation/browser-support.md) ·\n[Error Handling](documentation/error-handling.md) ·\n[Security Guide](documentation/security-guide.md)\n\nGenerate API docs locally with `pnpm run docs`.\n\n## Versioning\n\nThis project follows [Semantic Versioning](https://semver.org/).\n\n## Security\n\nSee [SECURITY.md](./SECURITY.md) for vulnerability disclosure policy and\nsupported versions.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcstraube%2Fzappzarapp-node-browser-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcstraube%2Fzappzarapp-node-browser-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcstraube%2Fzappzarapp-node-browser-utils/lists"}