Simple, zero-dependencies NodeJS/JavaScript library to store and retrieve metadata in PNG files.
Use your favourite package manager
npm install meta-png
# or: yarn add meta-png
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
getMetadata
beforehand and assert that it gives back undefined
.