The `ase-parser` library provides a pure JavaScript solution for parsing Aseprite `.aseprite` files into a structured object, enabling programmatic access to sprite data like frames, layers, cels, slices, tilesets, and palettes. Currently at version `0.0.18`, it's actively maintained with a focus on adding support for newer Aseprite features like Aseprite 1.3 fields, tilesets, tilemap layers, and linked cels. It ships with TypeScript types, facilitating its use in modern TypeScript projects. A key differentiator is its minimal footprint, having no runtime dependencies for the core parsing functionality. While examples might utilize libraries like `sharp` for image manipulation, `ase-parser` itself focuses solely on data extraction. The `0.0.x` versioning suggests ongoing development, with feature additions and bug fixes released as needed, and implies that breaking changes could occur in minor versions.
npm install ase-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate and parse an Aseprite file using `ase-parser`, logging basic sprite information. It includes a placeholder for reading a file and basic error handling for file not found.
Pin exact versions (e.g., `"ase-parser": "0.0.18"`) or thoroughly test updates before deploying to production.
Only install `sharp` (`npm install sharp`) if your application explicitly needs image processing capabilities. If not, omit it from your `package.json`.
Update to `ase-parser@0.0.16` or newer to resolve issues with ICC color profile data processing. This fix improved parsing robustness for certain file types.
Ensure `aseFile.parse();` is called immediately after instantiating `new Aseprite(buffer, name);` and before accessing any parsed data.
For ESM, use `import Aseprite from 'ase-parser';`. For CommonJS, use `const Aseprite = require('ase-parser');`. Ensure you are calling `new Aseprite(...)` to create an instance.After creating `const aseFile = new Aseprite(buff, name);`, you must call `aseFile.parse();` to populate its properties from the Aseprite file data.
Run `npm install ase-parser` or `yarn add ase-parser` to install the package. Verify your `import` or `require` statement matches the package name.
Verify that the file path in `fs.readFileSync('./your_file.aseprite')` is correct and the file exists at that location relative to where your script is run.No dependency data recorded yet.