JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 84
  • Score
    100M100P100Q37863F
  • License Apache-2.0

A library for parsing Aseprite files.

Package Exports

  • @pixelation/aseprite

Readme

@pixelation/aseprite

A library for parsing Aseprite files.

Installation

npm install @pixelation/aseprite

Usage

To parse an Aseprite file, create a new instance of the Aseprite class with the file provided as an array buffer.

import { Aseprite } from "@pixelation/aseprite";

const response = await fetch("./example.aseprite");
const file = await response.arrayBuffer();

const sprite = new Aseprite(file);

Sprite data is now accessible from this instance.

// Contains information about the whole file.
sprite.header;

// Contains information about each frame in the file.
sprite.frames;

// Contains the file's palette (if one exists).
sprite.palette;

// For example to work with each frame in the image.
for (const frame of sprite.frames) {
    // Do something with each frame...
}