Small, tree-shakeable TypeScript wrappers around 40+ browser Web APIs.
import {
isClipboardApiAvailable,
copyToClipboard,
} from '@rtorcato/browser-common/clipboard'
if (isClipboardApiAvailable()) {
await copyToClipboard('hello world')
}
npm install @rtorcato/browser-commonUse with AI
A skill ships with the package so coding agents use browser-common correctly — whichever tool you're in.
Register the marketplace once, then install the plugin:
/plugin marketplace add rtorcato/browser-common/plugin install browser-common@browser-commonThey read the bundled AGENTS.md from node_modules — or paste these rules into your agent config.
- Import from the subpath: @rtorcato/browser-common/<module> — never the package root.
- Feature-guard before use: call is<Name>Available() first; wrappers no-op
(return null/false) on unsupported runtimes instead of throwing.
- clipboard, geolocation, mediadevices, notifications, serviceworkers need
HTTPS (or localhost) plus a permission grant.
- SSR / Node safe: imports are side-effect-free; calls no-op without window.
One subpath per Web API
Eight focused categories. 44 modules. Import exactly what you need.
Local, session, cookies, and the File System Access API.
Battery, geolocation, motion, orientation, idle and screen state.
Clipboard, drag-and-drop, focus, forms, keyboard, pointer and touch.
Canvas, HTML media, devices, vibration and web-share.
DOM helpers, fullscreen, iframe, history, location and window.
IntersectionObserver, MutationObserver, ResizeObserver and PerformanceObserver.
Background tasks, service workers, web locks and WebSockets.
Alerts, notifications, print, encoding, permissions and shared helpers.
Sibling projects
More from @rtorcato — same conventions, same release pipeline.
Tree-shakeable TypeScript utilities — tiny bundles, full type safety, CLI included.
Framework-agnostic building blocks for Node.js APIs — errors, auth, rate limiting, OpenAPI, Express + Hono.
Shared, tree-shakeable TypeScript database utilities for Node projects.
Typed TypeScript wrappers and helpers for Cloudflare bindings and APIs.
Published React 19 component library — shared UI primitives.
SwiftUI package of reusable views and helpers to build apps faster.
Shared, tree-shakeable TypeScript helpers for Supabase — client, auth, and database utilities.
One wizard to scaffold TypeScript, linting, testing, and releases for any JS project.
Production-grade database schema deployment with the ergonomics of a JSX component.