Home Reference Source Test Repository

png-datastream

A library that provides parser / serializer for PNG datastream that can be able to use in browser environment.

Build Status npm version Document Coverage

Installation

npm install png-datastream

Example

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

API Document

https://doc.esdoc.org/github.com/xKerman/png-datastream/

Development

# test
npm test
# check coding style
npm run eslint
# generate document
npm run esdoc

License

MIT License