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/loadable-element

v0.2.2

Published

LoadableElement base for Neutron elements

Readme

loadable-element

Loading / success / error state, a provision, and the three events — once, for every element that does async work.

Features

  • Three states is-loading / is-success / is-error, mutually exclusive
  • Stale-while-revalidate did-load is set on the first success, kept through a refresh, cleared on an error — keep content on screen during a refresh
  • One payload The result or the error lands on provision
  • Three events {tag}-loading / {tag}-success / {tag}-error, tag-prefixed automatically
  • Four effects _setLoading, _setSuccess, _setError, _resetLoadState — the element decides when, the base does the bookkeeping

Installation

@excom/loadable-element v0.2.2

pnpm add @excom/loadable-element
npm install @excom/loadable-element
yarn add @excom/loadable-element

Import

import { /* … */ } from "@excom/loadable-element";

Usage

Compose LoadableElement and call its effects from your own lifecycles. FetchableElement (and every element built on it) and quark-sheet compose it this way.

import { LoadableElement } from "@excom/loadable-element";
import { Neutron } from "@excom/neutron";

export const LoadJson = Neutron.compose([
  LoadableElement,
  Neutron({ tag: "load-json", props: { srcUrl: String, _promise: Promise } }),
])
  .onPropSet("srcUrl", ({ srcUrl }) => [
    { _setLoading: [] },
    { _promise: fetch(srcUrl).then((r) => r.json()) },
  ])
  .onPromiseResolved("_promise", (_, { _promise }) => ({ _setSuccess: [_promise] }))
  .onPromiseRejected("_promise", (_, { _promise }) => ({ _setError: [_promise] }));

LoadJson.define();
<load-json src-url="/api/user"></load-json>
load-json[is-success] { $user: prop("provision"); }
load-json[is-error] [bind-message] { content: prop("provision").message; }

Cancelled or superseded work calls _resetLoadState (no event) — pair with abortable-element to abort the promise itself.

API Reference

Attributes

| Name | Surface | Type | Default | Values | Description | | --- | --- | --- | --- | --- | --- | | is-loading | state | boolean | | | Work is in flight. | | is-success | state | boolean | | | The most recent work finished successfully. Mutually exclusive with is-loading and is-error. | | is-error | state | boolean | | | The most recent work failed. Mutually exclusive with is-loading and is-success. | | did-load | state | boolean | | | Work has succeeded and no failure followed. Stays set while a refresh loads, so content can stay on screen (stale-while-revalidate): gate it on [did-load] rather than [is-success]. Cleared on error. |

Provision

| Name | Type | Description | | --- | --- | --- | | provision | unknown | The result of the most recent work on success, or the error payload on failure. Shape is defined by the composing element. Not reflected as an attribute. |

Fires

| Name | Type | Description | | --- | --- | --- | | {tag}-loading | LoadableLoadingEvent (CustomEvent & { type: "{tag}-loading"; detail: void; bubbles: true; cancelable: true; composed: true }) | After is-loading is set (work started). | | {tag}-success | LoadableSuccessEvent | After is-success is set. event.detail is the new provision. | | {tag}-error | LoadableErrorEvent | After is-error is set. event.detail is the error payload (also stored as provision). |

Release notes

0.2.0 (2026-09-30)

  • Add did-load: set on the first success, kept while a refresh loads and after a cancel, and cleared on an error, so content can stay on screen during a refresh with [did-load] instead of [is-success]

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/loadable-element