Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meta-png

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meta-png

Write and read metadata in PNG files.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by7.36%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • tEXt chunks inside PNG files are meant to use the Latin-1 standard: using characters outside this charset may lead to unwanted behaviors
  • No check is performed inside add functions to test whether a given key is already present in the file. If you need it, you can call getMetadata beforehand and assert that it gives back undefined.

Keywords

FAQs

Package last updated on 27 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc