lucach / meta-png

JavaScript library to store and retrieve metadata in PNG files
27 stars 2 forks source link

meta-png

NPM version codecov Test Lint

Simple, zero-dependencies NodeJS/JavaScript library to store and retrieve metadata in PNG files.

Installation

Use your favourite package manager

npm install meta-png
# or: yarn add meta-png

Usage

The library provides two functions to add a new metadata:

addMetadata(PNGUint8Array, key, value)  // stores the given key-value inside the PNG, provided as Uint8Array
addMetadataFromBase64DataURI(dataURI, key, value)  // stores the given key-value inside the PNG, provided as a Data URL string

and a function to get back the stored value:

getMetadata(PNGUint8Array, key)  // retrives the given key from a PNG provided as Uint8Array

Limitations