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

@aarsteinmedia/lottie-web

v1.5.0

Published

Play animations generated in After Effects in the browser

Readme

AM Lottie Web

A TypeScript fork of Airbnb's lottie-web, maintained for the Aarstein Media dotLottie player ecosystem.

Why this fork exists

  • Safer expressions — After Effects expressions are evaluated without eval, which improves security and performance.
  • SSR-friendly — Browser and Web API usage is guarded for Node and server rendering.
  • Better errors — Failures surface through typed events instead of failing silently.

This package is primarily built for @aarsteinmedia/dotlottie-player and @aarsteinmedia/dotlottie-react. Other use cases are supported, but inherited from upstream lottie-web behavior.

Installation

pnpm add @aarsteinmedia/lottie-web

If you use the dotLottie entry point, install the peer dependency as well:

pnpm add fflate

Entry points

| Import | Description | | --- | --- | | @aarsteinmedia/lottie-web | Full build: SVG + canvas renderers, effects, and expressions | | @aarsteinmedia/lottie-web/light | SVG renderer only, no expressions | | @aarsteinmedia/lottie-web/svg | SVG renderer with expressions | | @aarsteinmedia/lottie-web/canvas | Canvas renderer with expressions | | @aarsteinmedia/lottie-web/utils | Shared helpers and enums | | @aarsteinmedia/lottie-web/dotlottie | dotLottie archive utilities |

Basic usage

import lottie, { loadAnimation } from '@aarsteinmedia/lottie-web'
import type { AnimationItem } from '@aarsteinmedia/lottie-web'
import { PlayerEvent } from '@aarsteinmedia/lottie-web/utils'

const container = document.getElementById('animation')

const animation: AnimationItem = loadAnimation({
  container,
  renderer: 'svg',
  loop: true,
  autoplay: true,
  path: '/animations/hero.json',
})

animation.addEventListener(PlayerEvent.Complete, () => {
  console.log('Animation finished')
})

// Later
animation.destroy()

Inline animation data

import animationData from './animation.json'

const animation = loadAnimation({
  container: document.getElementById('animation'),
  renderer: 'svg',
  animationData,
  autoplay: false,
})

SVG-only bundle (smaller)

import lottie from '@aarsteinmedia/lottie-web/svg'

Events

AnimationItem extends a small event emitter. Common events include:

| Event | When it fires | | --- | --- | | DOMLoaded | Animation is ready to play | | enterFrame | Each rendered frame | | complete | Playback reached the end | | loopComplete | A loop iteration finished | | configError | Invalid configuration or data | | renderFrameError | A frame failed to render | | destroy | Animation is being torn down |

Import event names from @aarsteinmedia/lottie-web/utils:

import { PlayerEvent } from '@aarsteinmedia/lottie-web/utils'

animation.addEventListener(PlayerEvent.RenderFrameError, (event) => {
  console.error(event?.nativeError)
})

Development

pnpm install
pnpm dev        # preview player with live reload
pnpm lint       # eslint
pnpm test       # vitest
pnpm prod       # typecheck + production build
pnpm check      # lint, test, build, and verify version injection

Sample Lottie JSON files live in assets/ and are used by the preview app and test suite.

License

GPL-2.0-or-later. See upstream lottie-web licensing implications if you distribute combined or derivative works.