A library that provides parser / serializer for PNG datastream that can be able to use in browser environment.
npm install png-datastream
import Datastream from 'png-datastream';
// say you got `buf`, PNG ArrayBuffer from somewhere...
// parse ArrayBuffer as PNG datastream
const datastream = Datastream.fromArrayBuffer(buf);
datastream.signature; // PNG signature
datastream.chunks.forEach(chunk => { /* operation for each chunk */ });
const result = datastream.toArrayBuffer(); // serialize PNG datastream as ArrayBuffer
https://doc.esdoc.org/github.com/xKerman/png-datastream/
# test
npm test
# check coding style
npm run eslint
# generate document
npm run esdoc