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

@excom/detect-features

v0.1.4

Published

<detect-features> custom element

Readme

detect-features

Feature detection — gate content on real browser support with plain CSS.

<div>
  <detect-features></detect-features>
  <p>Geolocation supported in this browser.</p>
  <p role="alert">Geolocation is not supported in this browser.</p>
  <small role="note">See "Live document" tab below to see the <code>full-support</code> and <code>no-support</code> attributes populated with all of your browser's features.</small>
  <style>
    #demo-detect-features-simple {
      &:has(detect-features[full-support~="geolocation"]) p[role="alert"] {
        display: none;
      }
      &:has(detect-features:not([full-support~="geolocation"])) p:not([role="alert"]) {
        display: none;
      }
    }
  </style>
</div>

Features

  • Support tokens Set once on connect for CSS / Quark targeting
  • CSS-selectable Gate content with attribute selectors, no polyfills
  • JS / Quark data .provision exposes fullSupport / noSupport arrays
  • Common Web APIs Geolocation, share, bluetooth, clipboard, media-devices, service-worker, payment-request, and many more

Installation

@excom/detect-features v0.1.4

pnpm add @excom/detect-features
npm install @excom/detect-features
yarn add @excom/detect-features

Import

import "@excom/detect-features";

Usage

Check full-support / no-support for a space-separated feature name.

<detect-features></detect-features>

Use CSS or Quark to react to the feature detection:

detect-features:not([full-support~="geolocation"]) ~ .needs-location {
  display: none;
}

API Reference

Attributes

| Name | Surface | Type | Default | Values | Description | | --- | --- | --- | --- | --- | --- | | full-support | state | tokenlist | | "geolocation" | "vibrate" | "bluetooth" | "usb" | "serial" | "hid" | "share" | "clipboard" | "credentials" | "media-devices" | "service-worker" | "storage" | "wake-lock" | "gpu" | "locks" | "permissions" | "connection" | "user-agent-data" | "battery" | "midi" | "webxr" | "virtual-keyboard" | "window-controls-overlay" | "contacts" | "local-storage" | "session-storage" | "indexed-db" | "notification" | "payment-request" | "web-socket" | "worker" | "shared-worker" | "broadcast-channel" | "intersection-observer" | "resize-observer" | "speech-synthesis" | "eye-dropper" | "barcode-detector" | "file-system-access" | "webrtc" | "dialog" | "view-transitions" | "cookie-store" | "offscreen-canvas" | Space-separated feature names fully supported by this browser. | | partial-support | state | tokenlist | | | Reserved for features with partial / conditional support. Not populated yet — see INTERNAL.md. | | no-support | state | tokenlist | | "geolocation" | "vibrate" | "bluetooth" | "usb" | "serial" | "hid" | "share" | "clipboard" | "credentials" | "media-devices" | "service-worker" | "storage" | "wake-lock" | "gpu" | "locks" | "permissions" | "connection" | "user-agent-data" | "battery" | "midi" | "webxr" | "virtual-keyboard" | "window-controls-overlay" | "contacts" | "local-storage" | "session-storage" | "indexed-db" | "notification" | "payment-request" | "web-socket" | "worker" | "shared-worker" | "broadcast-channel" | "intersection-observer" | "resize-observer" | "speech-synthesis" | "eye-dropper" | "barcode-detector" | "file-system-access" | "webrtc" | "dialog" | "view-transitions" | "cookie-store" | "offscreen-canvas" | Space-separated feature names with no support in this browser. | | granted-permissions | state | tokenlist | | | Reserved for features that require an explicit permission grant. Not populated yet — see INTERNAL.md. |

Provision

| Name | Type | Description | | --- | --- | --- | | provision | FeatureInfo ({ fullSupport: keyof typeof FEATURE_CHECKS[]; noSupport: keyof typeof FEATURE_CHECKS[]; }) | Same partitions as the token attributes, as string arrays for JS / Quark (fullSupport, noSupport). Not reflected as an attribute. |

Examples

Gate a whole section

full-support lists every feature this browser supports; no-support lists the rest. Wrap a whole section instead of one element by pairing :has() with the same attribute selector:

body:has(detect-features:not([full-support~="geolocation"])) #store-locator {
  display: none;
}

Web Share progressive UI

Show a share affordance only when share is listed in full-support. Browsers without Web Share keep the fallback copy instead.

<div>
  <detect-features></detect-features>
  <p>Web Share is available in this browser.</p>
  <p role="status">
    Web Share is not available — offer a copy-link fallback instead.
  </p>
  <small role="note">See "Live document" tab below to see the <code>full-support</code> and <code>no-support</code> attributes populated with all of your browser's features.</small>
  <style>
    #demo-detect-features-share {
      &:has(detect-features[full-support~="share"]) p[role="status"] {
        display: none;
      }
      &:has(detect-features:not([full-support~="share"])) p:not([role="status"]) {
        display: none;
      }
    }
  </style>
</div>

Release notes

0.1.1 (2026-09-23)

  • Ship only dist (and declared extras) in the npm tarball; drop build logs, tests and sources

Full documentation: https://nucleus.excom.dev/packages/detect-features