# Quick Start: Loading a .lottie File
Load an existing .lottie file from disk or bytes and inspect its animations, themes, and manifest with dotlottie-io.

# Quick Start: Loading a .lottie File

`DotLottie` can load an existing `.lottie` file directly from a filesystem path or from raw bytes.

## From a file path

```javascript
const { DotLottie } = require("@lottiefiles/dotlottie-io");

const dl = DotLottie.fromFile("package.lottie");

console.log(dl.animationIds());
console.log(dl.getManifestJson());
```

## From bytes

Useful when you already have the file's contents in memory (for example, from an upload):

```javascript
const { readFileSync } = require("node:fs");
const { DotLottie } = require("@lottiefiles/dotlottie-io");

const dl = DotLottie.fromBytes(readFileSync("package.lottie"));
console.log(dl.animationIds());
```

Both calls are **synchronous** and return a fully-loaded, mutable `DotLottie` instance — there's no separate `build()` step required for reading.

## Reading an animation's JSON

```javascript
const heroJson = dl.getAnimationJson("hero");
if (heroJson) {
  const parsed = JSON.parse(heroJson);
  console.log(parsed.nm, parsed.fr);
}
```

`getAnimationJson` (and the equivalent methods for themes, state machines, images, fonts, and audio) return `null` if the ID or filename isn't found — they never throw for a missing entry.

## v1 and v2 files

`dotlottie-io` reads both dotLottie v1 and v2 archive layouts transparently — you don't need to check the version before loading. See [The Manifest](/docs/tools/dotlottie-io/core-concepts/manifest) for how the two layouts differ.

## Loading large files without reading everything

If you only need a handful of entries from a large `.lottie` file, [`DotLottieReader`](/docs/tools/dotlottie-io/api/dotlottie-reader-class) reads the manifest only and fetches other entries on demand — see [Reading a .lottie File](/docs/tools/dotlottie-io/guides/reading-a-lottie-file) for when to reach for it instead of `DotLottie`.

Next up: [Architecture](/docs/tools/dotlottie-io/core-concepts/architecture)
