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

@ruverse/waves

v0.2.0

Published

Deterministic, configurable animated canvas waves for the web.

Readme

Waves

Open Waves

A deterministic animated-wave renderer and visual editor. The reusable renderer is published as @ruverse/waves; the Svelte app is the source for portable configurations, images, and embeds.

Package

Install the package:

npm install @ruverse/waves

Copy a compact string from the editor's Share menu and mount it directly into any sized element:

import { mountWave } from '@ruverse/waves';

const compact = 'waves:v1:{"s":42,"a":52,"n":7,"bg":"transparent"}';
const handle = mountWave(document.querySelector('#waves'), compact);

// Compact strings are complete snapshots, so omitted values return to defaults.
handle.update('waves:v1:{"s":84}');

// Object updates remain partial merges with the mounted configuration.
handle.update({ waveCount: 5 });

handle.destroy();

Create, encode, and decode compact strings programmatically:

import {
  createWaveConfig,
  decodeWaveConfig,
  encodeWaveConfig,
  mountWave
} from '@ruverse/waves';

const config = createWaveConfig({
  seed: 42,
  waveCount: 7,
  amplitude: 52,
  backgroundColor: 'transparent',
  waveColor: 'rgba(255, 255, 255, 0.14)',
  variations: {
    amplitude: 0.2,
    rotation: 0.04,
    spacing: 0.08
  }
});

const compact = encodeWaveConfig(config);
const normalized = decodeWaveConfig(compact);
mountWave(document.querySelector('#waves'), compact);

The default configuration encodes as waves:v1:{}. The codec validates aliases and payload types without evaluating code, and can be used during server rendering. The container controls the rendered size and must have non-zero width and height. The runtime has no dependencies, pauses while offscreen, respects reduced-motion preferences, and accesses browser globals only after mountWave() is called.

Build and test the publishable package:

bun run build:lib
bun run test:package
npm pack --dry-run

Repository builds prepare and attest release artifacts but do not publish them automatically.

Releases

Package releases are prepared on dev and moved to the release-only main branch through a release pull request. After the pull request is merged, an exact numeric tag matching package.json triggers the GitHub Actions release workflow.

The workflow runs the editor and package checks, creates and smoke-tests the npm tarball, attests its provenance, and attaches it to a draft GitHub Release for maintainer review. It does not publish to npm automatically. See AGENTS.md for the complete release procedure.

Visual editor

The editor lets you customize amplitude, wavelength, frequency, period, rotation, curvature, glitch, spacing, thickness, taper, colors, variation, and wave count. Configurations can be saved locally or shared as a portable compact string, image, or self-contained web embed.

Run Locally

Prerequisites:

  • Bun 1.3 or newer

Install dependencies:

bun install --frozen-lockfile

Start the development server:

bun run dev

Vite will print a local URL, usually http://localhost:5173/, where you can open the app in your browser.

To create a production build:

bun run build

To preview the production build locally:

bun run preview

Recommended IDE Setup

VS Code + Svelte.

Need an official Svelte framework?

Check out SvelteKit, which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.

Technical considerations

Why use this over SvelteKit?

  • It brings its own routing solution which might not be preferable for some users.
  • It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.

This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other create-vite templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.

Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.

Why global.d.ts instead of compilerOptions.types inside jsconfig.json or tsconfig.json?

Setting compilerOptions.types shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding svelte and vite/client type information.

Why include .vscode/extensions.json?

Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.

Why enable allowJs in the TS template?

While allowJs: false would indeed prevent the use of .js files in the project, it does not prevent the use of JavaScript syntax in .svelte files. In addition, it would force checkJs: false, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.

Why is HMR not preserving my local component state?

HMR state preservation comes with a number of gotchas! It has been disabled by default in both svelte-hmr and @sveltejs/vite-plugin-svelte due to its often surprising behavior. You can read the details here.

If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.

// store.ts
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)