Home

png-chunks-extractor 2.0.0

Basic PNG chunks extractor

NPM Version

Installation

png-chunks-extractor is a Node.js module. It is available as a npm package.

npm i png-chunks-extractor

Example

The package supports both ESM import and CJS require.

import chunksExtractor from 'png-chunks-extractor';

const {chunks, chunksByType} = await chunksExtractor('path/to/file');

chunks is an array of PNG chunks data and type.

{
  dataBuf: <Buffer 00 00 03 00 00 00 03 00 08 02 00 00 00>,
  type: 1229472850 // 'IHDR' decimal value
}

Documentation

chunksExtractor(PNGFile[, options])

Parses PNGFile and returns its chunks

Extended documentation