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

@wonder-partners/model-viewer-stats

v1.0.9

Published

A lightweight web component that displays comprehensive statistics for 3D models rendered with Google's `<model-viewer>`.

Downloads

889

Readme

<model-viewer-stats>

A lightweight web component that displays comprehensive statistics for 3D models rendered with Google's <model-viewer>.

Overview

model-viewer-stats is a custom HTML element that integrates as a child of <model-viewer>. It accesses the internal Three.js scene to calculate and display geometry and asset statistics as an overlay.

Displayed Statistics:

  • File Size: Head request content length.
  • Dimensions: Model dimensions from model-viewer public API (getDimensions()), in meters (W x H x D).
  • Triangles: Total triangle count.
  • Meshes: Number of mesh objects.
  • Materials: Number of unique materials.
  • Textures: Number of unique textures.
  • Animations: Count of available animations.

Installation

npm install @wonder-partners/model-viewer-stats

Peer Dependencies

This package requires @google/model-viewer v4.0.0 or higher as a peer dependency.

Usage

Import the package and use the <model-stats> element inside your <model-viewer>. Add the visible attribute if you want to show the overlay by default.

<script type="module">
  import '@google/model-viewer';
  import '@wonder-partners/model-viewer-stats';
</script>

<model-viewer src="/path/to/model.glb" camera-controls>
  <!-- Add 'visible' attribute to show the stats on load -->
  <model-stats visible></model-stats>
</model-viewer>

ES Module Import

import { ModelStats } from '@wonder-partners/model-viewer-stats';

UMD (CommonJS)

const { ModelStats } = require('@wonder-partners/model-viewer-stats');

API & Interaction

Attributes

  • visible: Presence of this boolean attribute makes the stats overlay visible.

Methods

You can programmatically toggle the visibility of the stats overlay using the toggle() method.

const statsComponent = document.querySelector('model-stats');

// Toggle visibility
statsComponent.toggle();

Styling

The component uses Shadow DOM and positions itself absolutely within the parent <model-viewer>. The overlay is non-interactive to avoid interfering with camera controls.

Development

Prerequisites

  • Node.js 18+
  • npm

Setup

git clone https://github.com/your-username/model-viewer-stats.git
cd model-viewer-stats
npm install

Start the development server

npm run dev

Build Output

The build produces two bundles in the dist/ directory:

  • model-viewer-stats.js - ES module
  • model-viewer-stats.umd.cjs - UMD/CommonJS bundle

External dependencies (@google/model-viewer, three) are not bundled.

Linting

This project uses Biome for linting and formatting.

npm run lint      # Check for issues
npm run format    # Auto-fix issues