Development

This document describes the process for setting up this library on your local computer.

Getting started

You'll need Node.js version 12 or 14 to build the library. To install Node.js, download the "LTS" installer from nodejs.org. If you're using nodenv, read the nodenv docs for instructions on switching Node.js versions.

Once you've installed Node.js (which includes the popular npm package manager), open Terminal and run the following:

git clone git@github.com:LottieFiles/lottie-js.git
cd lottie-js
yarn install
yarn test
yarn build

Guidelines

  • Use defensive programming techniques: Ensure type and range of input values, cast values to native representation whenever possible, etc.

  • Refrain from using external dependencies: Discuss before adding a dependency. Check with Bundlephobia for package size and dependencies when choosing one.

  • Use code formatting in the IDE using the given eslint+prettier configs.

  • Write tests to cover all functions and code branches with valid and invalid values.

Last updated