Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aseprite-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aseprite-loader

This is a webpack loader that loads [Aseprite](https://www.aseprite.org/) [`.ase` and `.aseprite` files](https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md) via [ase-parser](https://github.com/TheCyberRonin/ase-parser).

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

aseprite-loader

This is a webpack loader that loads Aseprite .ase and .aseprite files via ase-parser.

It sets module.exports of the file you're importing to an object of the type AsepriteLoader.Data as defined below:

declare namespace AsepriteLoader {
  interface Data {
    frames: Array<AsepriteLoader.Frame>;
    layers: Array<AsepriteLoader.Layer>;
    tags: Array<AsepriteLoader.Tag>;
    palette?: AsepriteLoader.Palette;
    fileSize: number;
    width: number;
    height: number;
    numFrames: number;
    colorDepth: number;
    numColors: number;
    pixelRatio: string;
    colorProfile: {
      type: string;
      flag: number;
      fGamma: number;
    };
  }

  interface Palette {
    paletteSize: number;
    firstColor: number;
    lastColor: number;
    colors: Array<Color>;
  }
  interface Color {
    red: number;
    green: number;
    blue: number;
    alpha: number;
    name: string;
  }
  interface Cel {
    layerIndex: number;
    xpos: number;
    ypos: number;
    opacity: number;
    celType: number;
    w: number;
    h: number;
    rawCelData: Uint8Array;
  }
  interface Tag {
    name: string;
    from: number;
    to: number;
    animDirection: string;
    color: string;
  }
  interface Layer {
    flags: number;
    type: number;
    layerChildLevel: number;
    blendMode: number;
    opacity: number;
    name: string;
  }
  interface Frame {
    bytesInFrame: number;
    frameDuration: number;
    numChunks: number;
    cels: Array<Cel>;
  }
}

NOTE: Even if a Cel is of type 2 (zlib compressed), the rawCelData will always be inflated, as if it was type 0. See the Aseprite File Format Specification for more info.

Usage

// webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.ase(prite)?$/i,
        use: ["aseprite-loader"],
      },
    ],
  },
};
const blueSlime = require("./blue-slime.aseprite");

console.log(blueSlime);
// Object { frames: [...], layers: [...], ... };

License

MIT

FAQs

Package last updated on 21 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc