New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ase

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ase

Aseprite file parser implemented in node

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

node-ase

Aseprite file parser implemented in node, based on the file spec. This parser does not support older Aseprite saves, as it skips over chunk types 0x0004 and 0x0011. It also skips over 0x2016 as it is deprecated.

Quick Start

Install with

$ npm i node-ase

Read .ase file example:

const readAse = require('node-ase');
const path    = require('path');

let filePath = path.join(__dirname, './myCoolSprite.ase');

(async () => {
  let aseFile;

  try {
    aseFile = await readAse(filePath);
  } catch(e) {
    console.log(e);
  }

  console.log( JSON.stringify(aseFile, null, 2) );
})();

You can also read .ase files synchronously using the included require hook:

const readAse = require('node-ase');

let aseFile = require('./myCoolSprite.ase');

console.log( JSON.stringify(aseFile, null, 2) );

Reading Information

node-ase will return an object containing all parsed data. It has two properties, header and frames.

The header property contains file header information, like file size, color depth, number of frames, etc.

The frames property contains all the frames for the project, as well as every chunk for that frame under the frames[n].chunks array. All layers in a frame are organized into the frames[n].layers array. A layer also has a layer.children array that contains all child layers.

For more information on ase files, see the spec.

License

MIT

Keywords

FAQs

Package last updated on 06 Feb 2018

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