New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →
Socket
Sign inDemoInstall
Socket

@icon-magic/svg-to-png

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icon-magic/svg-to-png

Icon magic blueprint package.

  • 2.6.0-beta.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
5
Weekly downloads
 
Created
Source

@icon-magic/svg-to-png

Quickly converts an SVG file to a PNG file using Puppeteer. On process start, it spins up os.cpus() - 1 independent browser instances to farm conversion tasks out across multiple processes. Exports two main methods:

async convertFile(fileName: string, options: SVGToPNGOptions): Promise

Given a path to a file, return the PNG buffer of the converted image.

async convert(contents: string, options: SVGToPNGOptions): Promise

Given the contents of a SVG file, return the PNG buffer of the converted image.

Options

Conversion options use the following interface:

interface SVGToPNGOptions {
  width: number; // Width of the output PNG.
  height: number; // Height of the output PNG.
  headless?: boolean; // If the browser converting the image should be headless or not. Useful for debugging.
}

FAQs

Package last updated on 17 Dec 2021

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