npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

wbh

v265.0.0

Published

πŸ”¨ Restrict access to your website from web browsers without specific features.

Readme

πŸ”¨ Web Browser Hard (WBH)

The API of this module is rapidly changing and is not intended for production or commercial use.

To suit your specific needs, it's necessary to fork this project (with attribution). You can expect v265+ to be more stable. 🌟

🎁 Features

  • 🧬 Modular: Use it on any framework (Svelte, Vue, etc.)
  • πŸ“Š Versatile: Pick from 70+ browser features to check
  • πŸŽ›οΈ Customizable: Set metadata per-feature with levels, scores, and wisdom text
  • 🌲 Tree-shakeable: Unused imports stay out of bundle
  • πŸš€ Easy to use: Comes with TypeScript types out of the box
  • πŸ“¦ Presets: Ready-made profiles for common app types (modern web apps, SPAs, e-commerce, etc.)
  • πŸ” Version inference: Infer minimum browser versions required by your feature set

Any question? Read Q&A on the wiki.

🧭 Example Code

Basic usage

import {
	WBH,
	WBHLevel as L,
	avif,
	fileSystemApi,
	cssAspectRatio,
} from '@mdrv/wbh'

const wbh = new WBH([
	{
		feat: avif,
		level: L.CRITICAL,
		score: 50,
		wisdom: 'Most images are optimized AVIF.',
	},
	{
		feat: fileSystemApi,
		level: L.IMPORTANT,
		score: 50,
		wisdom: 'Needed for local binary storage.',
	},
	{
		feat: cssAspectRatio,
		level: L.OPTIONAL,
		score: 49,
		wisdom: 'Some layouts depend on aspect ratio.',
	},
])

const result = await wbh.getResultAsync()
if (result.score >= 0) {
	// Render your app
} else {
	// Browser missing features β€” show fallback UI
}

Using presets

import { WBH, presets } from '@mdrv/wbh'

const wbh = new WBH(presets.modernWebApp())
const result = await wbh.getResultAsync()

console.log(result.unsupported.map((f) => f.name))

Browser version inference

const wbh = new WBH(presets.modernWebApp())
await wbh.getResultAsync()

const versions = wbh.inferMinimumVersions()
// { chrome: "120", firefox: "121", safari: "17", edge: "120" }

const comparison = wbh.compareBrowser('firefox', 115)
// { browser: "firefox", version: 115, status: "outdated", gap: 6, ... }

Options

new WBH(features, {
	cache: false, // opt-in: cache detection results (default off)
	mockUnsupported: false, // simulate all features unsupported (for testing)
})

πŸ”” Release Info

This package implements Gregorian YYM-based semver notation.

| Version | Date | | ---------- | ------------ | | v257.x.x | July 2025 | | v260.x.x | Oct–Dec 2025 | | v265.x.x | May 2026 |

See CHANGELOG for full history.


Breaking Changes

  • Renamed forceFail option β†’ mockUnsupported
  • Removed built-in CSS (css.ts) β€” handle your own fallback UI
  • Removed is-mobile dependency
  • Updated Result type: now includes timestamp and durationMs fields
  • Updated feature data: each feature now includes safari and edge version fields

New Features

  • Presets system (src/presets.ts) β€” 7 ready-made profiles:
    • modernWebApp() β€” CSS nesting, grid, container queries, dialog, view transitions
    • spa() β€” Single-page app essentials (view transitions, navigation API, promises)
    • contentSite() β€” Content-focused sites (text-wrap, viewport units, typography)
    • dataHeavy() β€” Data-intensive apps (IndexedDB, WebSockets, structuredClone)
    • cuttingEdge() β€” Latest APIs (anchor positioning, scroll timeline, declarative shadow DOM)
    • minimal() β€” Bare minimum for basic compatibility
    • ecommerce() β€” E-commerce features (dialog modals, payment API, popover)
  • inferMinimumVersions() β€” Returns min Chrome/Firefox/Safari/Edge versions needed
  • compareBrowser(browser, version) β€” Compare a browser version against requirements; returns current, outdated, or unsupported status
  • Opt-in cache via { cache: true } option (default off to avoid stale results)
  • Enriched Result β€” timestamp (Date.now()) and durationMs (performance.now())

New Feature Detections (+20)

| Feature | Level | Notes | | ---------------------- | --------- | --------------------------------- | | htmlDialog | CRITICAL | <dialog> + showModal | | viewTransitions | CRITICAL | View Transitions API | | cssNesting | CRITICAL | CSS nesting syntax | | cssHasSelector | CRITICAL | :has() relational selector | | structuredClone | CRITICAL | Deep cloning without hacks | | promiseWithResolvers | CRITICAL | Promise.withResolvers() | | arrayAt | IMPORTANT | Array.at() negative indexing | | arrayWith | IMPORTANT | Array.with() immutable mutation | | cssColorMix | IMPORTANT | color-mix() function | | viewportUnits | IMPORTANT | svh/lvh/dvh units | | cssFocusVisible | IMPORTANT | :focus-visible pseudo-class | | navigationApi | IMPORTANT | Navigation API (Chrome/Edge only) | | urlPattern | IMPORTANT | URLPattern API | | cssAnchorPositioning | OPTIONAL | Anchor positioning (Chrome only) | | declarativeShadowDom | OPTIONAL | Declarative Shadow DOM | | promiseTry | OPTIONAL | Promise.try() | | regexpEscape | OPTIONAL | RegExp.escape() | | importAttributes | OPTIONAL | Import attributes |

Internal Improvements

  • gen.ts now extracts Safari and Edge version data from MDN BCD + caniuse-db
  • types.ts cleaned up: caniuse is readonly string[], added reason?, BrowserVersionMap, BrowserComparison
  • dynamicImport no longer references removed is-mobile dep
  • Test suite expanded from 4 β†’ 10 tests covering all new functionality

πŸ’– Thank You

This project proudly uses:

  • 🧩 es-toolkit (modern JS utilities with TypeScript support)
  • πŸ₯Ÿ Bun.js (blazing fast server-side JS runtime)
  • πŸ“š Additional data: MDN and Can I use...