{"_id":"@armedi/convert-svg","_rev":"14-f638348d13e9109a5b6be5c2aea34d0b","name":"@armedi/convert-svg","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@armedi/convert-svg","version":"1.0.0","keywords":["svg","png","converter"],"author":{"name":"Armedi"},"_id":"@armedi/convert-svg@1.0.0","maintainers":[{"name":"armedi","email":"armedi@outlook.com"}],"homepage":"https://github.com/armedi/convert-svg#readme","bugs":{"url":"https://github.com/armedi/convert-svg/issues"},"bin":{"convert-svg":"bin/convert-svg.js"},"dist":{"shasum":"fb88984942f3a05c3f462416228e9b1afeb1ac9a","tarball":"https://registry.npmjs.org/@armedi/convert-svg/-/convert-svg-1.0.0.tgz","fileCount":4,"integrity":"sha512-aVHDsRno1fvdtuJoF1njT6FonBQ46Y0m0+3yByIDAAlsRYDqpmhM4SLTd2dwwHlGRWki9di/QeDOVDxr70mMvw==","signatures":[{"sig":"MEYCIQCDcANjfNolmzVe3TYSol85Wl6DFSqn6rN2+c05b5GpSwIhAJmoNt1AfiMyGFF5+bofT7CwToFIi0t1nYiKos3sgWzD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11937},"main":"main.js","type":"commonjs","gitHead":"ecdff8e914e22937dea048c711eac6d8753f5f51","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"armedi","email":"armedi@outlook.com"},"repository":{"url":"git+https://github.com/armedi/convert-svg.git","type":"git"},"_npmVersion":"11.9.0","description":"Convert SVG images to PNG with ease. A lightweight CLI tool powered by Playwright's Chromium engine for pixel-perfect rendering.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"playwright":"^1.59.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/convert-svg_1.0.0_1775708271133_0.8323458548593281","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@armedi/convert-svg","version":"1.0.1","description":"Convert SVG images to PNG with ease. A lightweight CLI tool powered by Playwright's Chromium engine for pixel-perfect rendering.","main":"main.js","bin":{"convert-svg":"bin/convert-svg.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["svg","png","converter"],"author":{"name":"Armedi"},"repository":{"type":"git","url":"git+https://github.com/armedi/convert-svg.git"},"type":"commonjs","dependencies":{"playwright":"^1.59.1"},"gitHead":"8c603c17d8ddfbcf8cd2492ae4743a09b54e336d","_id":"@armedi/convert-svg@1.0.1","bugs":{"url":"https://github.com/armedi/convert-svg/issues"},"homepage":"https://github.com/armedi/convert-svg#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-wWPeNdouw5hHPsD3RO4QOBWO5Ezyq0VE7ThjLMfk1rq/TIxg9T0p4M/5FQKwVhJ6rGMIMirpZd9pu+DVgaRPUQ==","shasum":"5355bd1cbcf29ddfba74e04cb3e6dc8f9bdf2757","tarball":"https://registry.npmjs.org/@armedi/convert-svg/-/convert-svg-1.0.1.tgz","fileCount":4,"unpackedSize":11595,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFPUkfAGFDBZsXMtbBDzGQdUM7X2aXipEQPIYFB+YHe4AiAYNx21D/uimYuIQ6sY3YgUD7hQudnoT1wsgFPMilkFBQ=="}]},"_npmUser":{"name":"armedi","email":"armedi@outlook.com"},"directories":{},"maintainers":[{"name":"armedi","email":"armedi@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/convert-svg_1.0.1_1775708587462_0.27933174226753077"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T03:57:55.719Z","modified":"2026-04-09T04:23:07.721Z","0.1.0":"2026-04-09T03:57:55.935Z","0.1.1":"2026-04-09T03:59:25.821Z","0.1.2":"2026-04-09T04:01:12.096Z","0.2.0":"2026-04-09T04:02:13.433Z","0.1.3":"2026-04-09T04:03:20.020Z","0.1.4":"2026-04-09T04:10:41.966Z","1.0.0":"2026-04-09T04:17:51.269Z","1.0.1":"2026-04-09T04:23:07.605Z"},"bugs":{"url":"https://github.com/armedi/convert-svg/issues"},"author":{"name":"Armedi"},"homepage":"https://github.com/armedi/convert-svg#readme","keywords":["svg","png","converter"],"repository":{"type":"git","url":"git+https://github.com/armedi/convert-svg.git"},"description":"Convert SVG images to PNG with ease. A lightweight CLI tool powered by Playwright's Chromium engine for pixel-perfect rendering.","maintainers":[{"name":"armedi","email":"armedi@outlook.com"}],"readme":"# 🎨 convert-svg\n\nConvert SVG images to PNG with ease. A lightweight CLI tool powered by Playwright's Chromium engine for pixel-perfect rendering.\n\n[![npm version](https://img.shields.io/npm/v/convert-svg.svg)](https://www.npmjs.com/package/convert-svg)\n[![npm downloads](https://img.shields.io/npm/dm/convert-svg.svg)](https://www.npmjs.com/package/convert-svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## ✨ Features\n\n- **🚀 Simple CLI** – Minimal, intuitive command-line interface\n- **🎯 Accurate Rendering** – Powered by Chromium for pixel-perfect conversions\n- **📐 Flexible Sizing** – Specify width, height, or let aspect ratio handle it\n- **🔄 Smart Defaults** – Intelligently derive output names and dimensions\n- **📦 Zero Config** – Works out of the box, no setup required\n\n## 📦 Installation\n\nInstall globally to use as a command-line tool:\n\n```bash\nnpm install -g @armedi/convert-svg\n```\n\nOr use with `npx` without installation:\n\n```bash\nnpx @armedi/convert-svg --input icon.svg --output icon.png\n```\n\n## 🚀 Quick Start\n\nConvert an SVG to PNG with automatic naming:\n\n```bash\nconvert-svg -i logo.svg\n# Creates: logo.png\n```\n\nSpecify a custom output file:\n\n```bash\nconvert-svg -i icon.svg -o custom-icon.png\n```\n\nResize while maintaining aspect ratio:\n\n```bash\nconvert-svg -i illustration.svg -w 1024\n# Width set to 1024px, height calculated from original ratio\n```\n\nSpecify exact dimensions:\n\n```bash\nconvert-svg -i graphic.svg -w 800 -h 600\n```\n\n## 📋 Usage\n\n```bash\nconvert-svg [options]\n```\n\n### Options\n\n| Option     | Alias | Description                   | Example                                  |\n| ---------- | ----- | ----------------------------- | ---------------------------------------- |\n| `--input`  | `-i`  | Input SVG file **(required)** | `convert-svg -i input.svg`               |\n| `--output` | `-o`  | Output PNG file               | `convert-svg -i input.svg -o output.png` |\n| `--width`  | `-w`  | Output width in pixels        | `convert-svg -i input.svg -w 512`        |\n| `--height` | `-h`  | Output height in pixels       | `convert-svg -i input.svg -h 512`        |\n| `--help`   |       | Show help message             | `convert-svg --help`                     |\n\n### Smart Sizing\n\n- **Only width provided?** Height is calculated to maintain the original SVG's aspect ratio\n- **Only height provided?** Width is calculated to maintain the original SVG's aspect ratio\n- **Neither specified?** Original SVG dimensions are used\n- **Both provided?** Output matches exactly\n\n## 💡 Common Use Cases\n\n### Generate Multiple Sizes for Responsive Images\n\n```bash\nconvert-svg -i icon.svg -w 256 -o icon-256.png\nconvert-svg -i icon.svg -w 512 -o icon-512.png\nconvert-svg -i icon.svg -w 1024 -o icon-1024.png\n```\n\n### Create Optimized Social Media Assets\n\n```bash\nconvert-svg -i logo.svg -w 1200 -h 630 -o og-image.png\n```\n\n## 🛠️ How It Works\n\n`convert-svg` uses [Playwright](https://playwright.dev/) with Chromium to render SVG files, ensuring:\n\n- **Accurate rendering** of complex SVGs with CSS, animations, and nested elements\n- **Cross-platform consistency** – same output on macOS, Linux, and Windows\n- **Proper color management** and anti-aliasing for quality output\n\nThe tool creates a temporary HTML file, loads the SVG into Chromium, and captures the rendered output as PNG.\n\n## 📝 Requirements\n\n- Node.js 14 or later\n- Chromium (automatically installed with Playwright)\n\n## 🤝 Contributing\n\nFound a bug or have a feature request? Open an issue on [GitHub](https://github.com/armedi/convert-svg/issues).\n\n## 📄 License\n\nMIT © [Armedi](https://github.com/armedi)\n\n---\n\n**Built with ❤️ for the open source community**\n","readmeFilename":"README.md"}