
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
deca-svgify
Advanced tools
A TypeScript-based NPM package that converts image data (such as canvas, PNG, or JPEG) into scalable vector graphics (SVG).
npm install deca-svgify
import { imageToSvg } from 'deca-svgify';
const canvas = document.getElementById('myCanvas') as HTMLCanvasElement;
const ctx = canvas.getContext('2d')!;
ctx.fillRect(0, 0, 100, 100);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const svgElement = imageToSvg(imageData, {
backgroundColor: '#f0f0f0',
viewBox: '0 0 100 100',
style: {
border: '1px solid #ccc'
}
});
document.body.appendChild(svgElement);
imageToSvg(imageData: ImageData, options?: SVGOptions)Converts the provided ImageData object to an SVGElement.
imageData (ImageData): An object containing the image data, including width, height, and pixel data.options (SVGOptions, optional): An object with the following optional properties:
backgroundColor: A CSS color value to set as the SVG background.viewBox: A string representing the viewBox attribute of the SVG element.style: An object of CSS styles to apply to the SVG element.An SVGElement representing the converted image.
Vectorizing images, or converting them to the SVG format, allows you to scale the graphics without losing quality. This is particularly useful for elements like logos, icons, or illustrations that need to be displayed at different sizes in your web application.
If you find any issues or have suggestions for improvements, please feel free to open a GitHub issue or submit a pull request.
This project is licensed under the MIT License.
FAQs
Convert image data to scalable vector graphics (SVG)
We found that deca-svgify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.