finds.dev

domenic/svg2png

Converts SVGs to PNGs, using PhantomJS

View on GitHub

★ 602JavaScriptNOASSERTIONupdated Jan 2021

// the take

A small Node wrapper that rasterizes SVG to PNG by driving PhantomJS's headless WebKit. It offers a promise-based API, a sync variant for shell scripts, and a CLI binary, aimed at build pipelines or scripts that need quick SVG-to-PNG conversion without a browser.

The resizing logic is unusually well thought out — it replicates actual browser behavior for width/height/viewBox combinations instead of guessing, and the README documents the exact rules. It supports external resource resolution via filename/url options for SVGs that reference relative assets. Offering both async and sync APIs plus a CLI covers the common use cases without extra dependencies on the consumer's side.

The entire rendering pipeline depends on PhantomJS, which has been dead and unmaintained since 2018 — its WebKit engine is years out of date and will never get security or rendering fixes. The repo itself has had no commits since early 2021, and its own issue tracker has a 'blocked on phantomjs' label acknowledging upstream is never coming back. phantomjs-prebuilt pulls a prebuilt binary on install, which is a common source of CI failures and is flagged or blocked outright in many modern Docker/Alpine/CI setups. Anyone adopting this today is building on an engine with no path forward — better to use a Playwright/Chromium-based or resvg-based alternative for anything beyond legacy maintenance.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
602
Forks
135
Language
JavaScript
License
NOASSERTION
Last commit
15 Jan 2021

// nearby

If svg2png isn't quite it.

All repos →