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

@v5x/web

v0.1.5

Published

Browser workflow layer for VEX V5 Web Serial applications

Readme

@v5x/web

Browser workflow layer for VEX V5 Web Serial applications.

@v5x/web wraps @v5x/serial with a small subscription-based client that tracks connection status, Web Serial support, and normalized errors.

import { createV5Client } from "@v5x/web";

const client = createV5Client();

client.subscribe(() => {
  console.log(client.getSnapshot());
});

const connected = await client.connect();

if (connected) {
  await client.refresh();
}

Web Serial is browser-only and requires HTTPS or localhost. Call connect() from a user gesture so the browser can show the permission prompt. Concurrent connect() calls share the active connection attempt and resolve to the same outcome.

Pass refreshIntervalMs to enable background refreshes. When provided, it must be a positive finite number; createV5Client() throws a RangeError for zero, negative, NaN, or infinite values.

When Web Serial is unavailable, V5Snapshot.unavailableReason and getWebSerialUnavailableReason() return one of these stable strings, in this detection order:

  • non-browser-runtime: window or navigator is not available.
  • insecure-context: the page is not running in a secure context.
  • unsupported-browser: the current browser is known not to support Web Serial, such as Firefox or Safari.
  • web-serial-unavailable: navigator.serial is still missing after the runtime, security, and known-browser checks pass.

If a background or explicit refresh() fails, the snapshot moves to error with a normalized refresh-error. The stale device is disconnected or disposed, background refresh stops, and the attached device is cleared. Call connect() again to make a fresh connection attempt; call disconnect() from the error state to clear the error and return to idle without retrying.

In device snapshots, the primary controller's isCharging value is a boolean. The partner controller's value is boolean | undefined: undefined means the device did not report that charging state, while false means it reported that the partner controller is not charging.

Framework bindings are available as subpath exports:

import { V5Provider, useV5Snapshot } from "@v5x/web/react";
import { createV5State } from "@v5x/web/svelte";
import { createV5Snapshot } from "@v5x/web/solid";

Testing and examples that need a fake device can use the testing subpath:

import { createV5ClientWithFactory } from "@v5x/web/testing";