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

@networked-art/context

v0.1.2

Published

Live Networked Art auction and patron context for interactive artwork

Readme

@networked-art/context

A tiny, dependency-free browser SDK that gives interactive artwork live Networked Art patron and auction state. It works anywhere the artwork can make a cross-origin request, including marketplace animation_url embeds. Ethereum mainnet is implicit; no chain ID is required or encoded.

The current value is returned from load, passed to watch listeners, and published as globalThis.NETWORKED_CONTEXT:

{
  collection: '0x…',
  tokenId: '7',
  patronCount: 12,
  lastPatron: '0x…',
  highestBidder: '0x…',
  highestBid: 125,
  bidCount: 4,
  available: true,
  source: 'api' // 'api' | 'fixed' | 'fallback' | 'stale'
}

highestBid is a whole USD amount. Addresses are lowercase. Missing addresses are null, and missing counts or amounts are zero.

Plain browser usage

Pin a version in permanent artwork. For strict CSP or long-term archival reliability, vendor index.global.js with the artwork instead of relying on a CDN.

<script src="https://cdn.jsdelivr.net/npm/@networked-art/[email protected]/dist/index.global.js"></script>
<script>
  NetworkedArt.load({
    collection: '0x0000000000000000000000000000000000000000',
    tokenId: '7',
  }).then((context) => {
    console.log(context.patronCount)
  })
</script>

The same identity can be provided by the artwork URL:

?networked_collection=0x…&networked_token_id=7

p5.js

let context

function setup() {
  createCanvas(windowWidth, windowHeight)
  NetworkedArt.watch({}, (next) => {
    context = next
  })
}

function draw() {
  background(context?.patronCount ?? 0)
}

Three.js / ES modules

import { watch } from '@networked-art/context'

const stop = watch({ collection: '0x…', tokenId: '7' }, (context) => {
  mesh.scale.setScalar(1 + context.bidCount / 10)
})

// Call when the artwork is torn down.
stop()

watch refreshes every 10 seconds by default, refreshes when a hidden document becomes visible, and preserves the last good values with source: 'stale' if the API becomes unavailable. Set intervalMs: 0 for a single load.

Fallback and fixed state

Artwork should remain renderable without the API:

await NetworkedArt.load({
  collection: '0x…',
  tokenId: '7',
  fallback: {
    patronCount: 0,
    lastPatron: null,
    highestBidder: null,
    highestBid: 0,
    bidCount: 0,
  },
})

For a deterministic snapshot, pass all five values through fixed, or create a complete URL with toQuery(context). A fixed URL uses:

networked_mode=fixed
networked_patron_count=12
networked_last_patron=0x…
networked_highest_bidder=0x…
networked_highest_bid=125
networked_bid_count=4

An empty fixed address means null. Fixed mode is atomic: if any of the five fields is missing or invalid, the SDK returns the configured fallback and emits networked-context:error; it never mixes fixed and live state.

Events

Every published value emits networked-context:change. Resolution failures emit networked-context:error.

addEventListener('networked-context:change', ({ detail }) => render(detail))
addEventListener('networked-context:error', ({ detail }) =>
  console.warn(detail.message),
)

The public API used by the SDK is GET https://api.networked.art/context/v1/:collection/:tokenId.