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

@tegos/spindle

v0.1.1

Published

360° frame-sequence spinner (object + aerial orbit). Vanilla TypeScript, zero deps.

Readme

spindle

npm bundle size zero deps license demo

360° frame-sequence spinner for the web — object spins and aerial orbits. Vanilla TypeScript, zero runtime dependencies, single <canvas> render.

A modern rewrite of an old jQuery + SpriteSpin viewer (e.g. lun.ua drone flyovers of a building complex). Viewer only — bring your own frames.

Features

  • Frame source: individual image URLs or a sprite sheet
  • Progressive loading: paints frame 1 and becomes interactive early, streams the rest (onProgress / onReady)
  • Drag + touch with momentum/inertia and wraparound looping
  • Autoplay until the user grabs
  • Zoom (pinch / scroll / double-tap) + pan within the current frame
  • Fullscreen toggle
  • ESM + UMD builds with type definitions

Install

npm install @tegos/spindle

Usage

import { Spindle } from '@tegos/spindle'

const s = new Spindle('#jk-avalon', {
  source: ['lun/1.jpg', 'lun/2.jpg', /* … */], // or { sheet, frames, fw, fh }
  autoplay: true,
  loop: true,
  momentum: true,
  zoom: true,
  fullscreen: true,
  onProgress: (p) => console.log(`${Math.round(p * 100)}%`),
  onReady: () => console.log('ready'),
})

s.goto(12)
s.play()
s.stop()
s.fullscreen()
s.destroy()

The target element needs a size from CSS; spindle fills it.

Sprite sheet source

new Spindle('#viewer', {
  source: { sheet: 'orbit.jpg', frames: 36, fw: 800, fh: 450, cols: 6 },
})

Options

| Option | Default | Meaning | |---|---|---| | source | — | Frame URLs string[] or { sheet, frames, fw, fh, cols? } (required) | | autoplay | false | Spin on load until grabbed | | loop | true | Wrap around at the ends | | momentum | true | Fling with inertia on release | | zoom | true | Pinch / scroll / double-tap zoom + pan | | fullscreen | true | Show a fullscreen toggle | | pxPerFrame | 8 | Drag pixels per frame step | | autoplayFps | 12 | Frames/sec during autoplay | | maxZoom | 4 | Max zoom factor | | onProgress(p) | — | Load progress 0..1 | | onReady() | — | First frame painted, interactive |

API

new Spindle(target, options)target is a selector or element.

  • goto(i) — jump to a frame (wrapped or clamped per loop)
  • play() / stop() — start / stop autoplay
  • fullscreen() — toggle fullscreen
  • resetZoom() — back to fit view
  • destroy() — tear down listeners and DOM
  • frame (get) — current frame index
  • length (get) — total frames

Develop

npm install
npm run dev      # vite dev server doubles as the examples (examples/)
npm test         # vitest
npm run build    # dist/: ESM + UMD + .d.ts

Examples

npm run dev serves examples/ (vite) with two viewers:

  • Aerial orbit — drone flyover of ЖК Avalon Holiday
  • Product spin — object turntable

Demo frames are for demonstration only — see the CREDITS.md next to each set. Aerial frames are a drone flyover from lun.ua; the product turntable is a generic sample found online (source unknown, unaffiliated with lun.ua). Supply your own frames for production use.

License

MIT (code only — see demo frame credits above).