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/provider-orientation

v0.1.4

Published

<provider-orientation> custom element

Readme

provider-orientation

Declarative device orientation / compass — request a heading, read the normalized bearing from attributes/state.

Features

  • Attribute-driven Request + read a compass heading through attributes
  • Normalized bearing 0–360° from magnetic north on both iOS and Android, one shape either way
  • Throttled updates compass-throttle-ms caps update frequency (Android can fire 60-200 Hz)
  • iOS-aware Works with the required user-gesture permission flow

Installation

@excom/provider-orientation v0.1.4

pnpm add @excom/provider-orientation
npm install @excom/provider-orientation
yarn add @excom/provider-orientation

Import

import "@excom/provider-orientation";

Usage

Requires a user gesture on iOS. DeviceOrientationEvent .requestPermission() must run synchronously inside a click handler or Safari denies it — so set is-paused and invoke the --request command from a button rather than relying on the connect-time auto-request (the handler runs in a microtask of the click, inside its user activation):

<button type="button" command="--request" commandfor="compass">
  Enable compass
</button>
<provider-orientation id="compass" is-paused></provider-orientation>
compass-needle {
  transform: rotate(calc(var(--bearing, 0) * 1deg));
}

Android and desktop browsers with a sensor don't require permission and will start listening as soon as the request fires; browsers with no sensor at all simply never report a reading.

API Reference

Attributes

| Name | Surface | Type | Default | Values | Description | | --- | --- | --- | --- | --- | --- | | is-paused | option | boolean | | | Skip requesting on connect. On iOS this is effectively required (a connect-time request happens outside a user gesture and will be denied) — pair with provider-orientation-request from a click handler instead (see class docs). | | compass-throttle-ms | option | number | 100 | | Minimum ms between provider-orientation-success updates. Android can fire deviceorientationabsolute at 60-200 Hz; without throttling that floods listeners and CSS/Quark bindings. | | is-requesting | state | boolean | | | iOS only: the permission request is pending (between provider-orientation-request and the user's response). | | is-success | state | boolean | | | Listening for orientation updates (permission granted where required). Stays set across updates. | | is-error | state | boolean | | | The permission request was denied, or listening failed to start. |

Provision

| Name | Type | Description | | --- | --- | --- | | provision | ProviderOrientationSuccess ({ bearing: number; alpha: number \| null; }) | Latest reading: { bearing, alpha } on success, or the error on failure. Not reflected as an attribute. |

Fires

| Name | Type | Description | | --- | --- | --- | | provider-orientation-success | ProviderOrientationSuccessEvent (CustomEvent & { type: "provider-orientation-success"; detail: { bearing: number; alpha: number \| null; }; bubbles: true; cancelable: true; composed: true }) | Dispatched on every compass update (throttled by compass-throttle-ms). bearing is normalized 0-360°; alpha is the raw DeviceOrientationEvent.alpha where available. | | provider-orientation-error | ProviderOrientationErrorEvent (CustomEvent & { type: "provider-orientation-error"; detail: string \| Error; bubbles: true; cancelable: true; composed: true }) | Dispatched when the permission request is denied, or fails for any other reason. |

Commands

| Command | Action | | --- | --- | | --request | Requests permission (iOS) and starts listening for orientation updates. Invoke it from a button (<button command="--request" commandfor="…">) so the user activation is there. |

Default actions

| Event | Default behavior (unless preventDefault() is called) | | --- | --- | | provider-orientation-success | Stores { bearing, alpha } in provision and sets is-success (clearing is-requesting / is-error). | | provider-orientation-error | Stores the error in provision and sets is-error (clearing is-requesting / is-success). |

Examples

Request on click

<div>
  <button type="button" command="--request" commandfor="orient">
    Enable compass
  </button>
  <provider-orientation id="orient" is-paused>
    <output></output>
  </provider-orientation>
  <p class="status">No reading yet — click above. Requires a device
    sensor (desktop browsers usually have none).</p>
  <quark-sheet>
    provider-orientation {
      $reading: prop("provision");
      &[is-success] output {
        content: if($reading.bearing != null: "Heading #{$reading.bearing.toFixed(0)}°"; else: "Listening — no reading yet.");
      }
      &[is-error] output { content: $reading.message or $reading; }
    }
  </quark-sheet>
</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/provider-orientation