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

sonicscroll

v1.0.0

Published

Scroll-triggered animation library with audio-aware mode. IntersectionObserver-based AOS alternative with SonicMotion integration. Zero dependencies.

Readme

📜 SonicScroll

Scroll-Triggered Animation Library with Audio-Aware Mode

npm bundle size npm version License: MIT

SonicScroll is a lightweight, zero-dependency JavaScript library for scroll-triggered animations powered by the IntersectionObserver API. It's a modern, framework-agnostic alternative to AOS (Animate On Scroll) — with an optional audio-aware mode that lets scroll animations react to music via SonicMotion.


✨ Features

  • 👀 IntersectionObserver-based: No scroll event listeners — performant by default.
  • 🎬 Built-in Animations: slideUp, fadeIn, scaleIn, slideLeft, slideRight, flipIn — out of the box.
  • 🎶 Audio-Aware Mode: Elements in the viewport can pulse or react to audio energy when music is playing.
  • 🧩 Declarative API: Use data-scroll HTML attributes — no JavaScript setup required for basic use.
  • 🔩 Fully Customizable: Register custom animation functions and combine with any Web Audio API source.
  • Zero Dependencies: Pure JavaScript, no build tool required.

💻 Installation

npm install sonicscroll
import SonicScroll from 'sonicscroll';

🚀 Quick Start

Option 1: Declarative HTML (Simplest)

<!-- Fades in when scrolled into view -->
<div data-scroll="fadeIn">Hello World</div>

<!-- Slides up with a 200ms delay -->
<section data-scroll="slideUp" data-scroll-delay="200">
  Delayed Section
</section>

<!-- Scales in from center -->
<img data-scroll="scaleIn" data-scroll-duration="800" src="photo.jpg" />
import SonicScroll from 'sonicscroll';

const scroll = SonicScroll.create();
scroll.init(); // Scans DOM for [data-scroll] automatically

Option 2: JavaScript API

import SonicScroll from 'sonicscroll';

const scroll = SonicScroll.create({ once: true, threshold: 0.2 });

scroll.animate('#hero', 'slideUp', { delay: 100 });
scroll.animate('.card', 'fadeIn', { duration: 600 });
scroll.animate('.logo', 'scaleIn');

Option 3: Audio-Aware Mode (with SonicMotion)

import SonicScroll from 'sonicscroll';

const scroll = SonicScroll.create();
scroll.init();

// Elements in viewport will pulse with the music
const audioAware = scroll.createAudioAware({
    selector: '[data-scroll]',   // Elements to watch
    stem: 'kick',                // Audio stem to react to
    effect: 'pulse'              // Effect while in viewport
});

sonic.onFrame((data) => {
    audioAware.update(data);
});

📐 HTML Attributes

| Attribute | Values | Description | |---|---|---| | data-scroll | animation name | Triggers animation on scroll-into-view | | data-scroll-delay | milliseconds | Delay before animation triggers | | data-scroll-duration | milliseconds | Duration of the animation | | data-scroll-distance | pixels | Distance the element travels (for slide animations) |


🎞️ Built-in Animations

| Animation | Description | |---|---| | slideUp | Slides element up from below | | fadeIn | Fades element in from invisible | | scaleIn | Scales element from 0 to full size | | slideLeft | Slides in from the right side | | slideRight | Slides in from the left side | | flipIn | Flips in from a perspective angle |

Register Custom Animations

import { ANIMATIONS } from 'sonicscroll';

ANIMATIONS['myAnimation'] = (element, config) => {
    element.style.opacity = '0';
    element.style.transform = 'rotate(45deg)';

    return () => {
        // Called when element enters viewport
        element.style.transition = 'all 0.5s ease';
        element.style.opacity = '1';
        element.style.transform = 'rotate(0deg)';
    };
};

🔌 JavaScript API

const scroll = SonicScroll.create(config);

scroll.init()                                    // Auto-parse [data-scroll] elements
scroll.animate(selector, animation, config)      // Manually bind animation
scroll.createAudioAware(config)                  // Enable audio-aware mode
scroll.destroy()                                 // Clean up all observers

🎵 Works Best With

  • sonicmotion — Audio stem analysis and DOM animation engine
  • sonicfx — Advanced audio-reactive visual effects
  • sonicwave — Canvas waveform and spectrum visualizations

📄 License

MIT © 2025 axscq