@reslear/dotlottie-player-core
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

dotLottie-player-core

Only fetching and parse functions.

npm npm Libraries.io dependency status for latest release NPM Unpacked Size install size semantic-release

🕹 Live Playground

Features

  • 🏎 High performance (using fflate)
  • ⚙️ Fetch API based
  • 📦 CJS and ESM support
  • 💪 fylly typed with TypeScript

Install

pnpm add @reslear/dotlottie-player-core

Usage

fetchLottie

fetch method for get animation and parse to lottie json.

import { fetchLottie } from '@reslear/dotlottie-player-core'

const lottieJson = await fetchLottie('/my-animation.lottie')

// {"v":"5.6.8","fr":24,"ip":0,"op":144,"w":2161,"h"...}

Arguments:

  1. url - path to .lottie, .json animation file

also support base64 data URI

fetchLottie('data:application/json;base64,<base64>')
  1. fetchOptions - Fetch API options
fetchLottie(url, {
  mode: 'no-cors',
})

Inspired

License

MIT by @reslear

Package Sidebar

Install

npm i @reslear/dotlottie-player-core

Weekly Downloads

39

Version

1.0.2

License

MIT

Unpacked Size

13.3 kB

Total Files

7

Last publish

Collaborators

  • reslear