Gathering detailed insights and metrics for @jephuff/canvg
Gathering detailed insights and metrics for @jephuff/canvg
Gathering detailed insights and metrics for @jephuff/canvg
Gathering detailed insights and metrics for @jephuff/canvg
npm install @jephuff/canvg
Typescript
Module System
Node Version
NPM Version
75.8
Supply Chain
93.6
Quality
74.5
Maintenance
100
Vulnerability
99.5
License
TypeScript (53.06%)
JavaScript (39.44%)
HTML (5.01%)
MDX (2%)
CSS (0.42%)
Shell (0.07%)
Total Downloads
16,487
Last Day
1
Last Week
1
Last Month
9
Last Year
131
MIT License
3,753 Stars
1,120 Commits
619 Forks
65 Watchers
22 Branches
39 Contributors
Updated on Jun 23, 2025
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
@jephuff/canvg@1.0.0
Size
29.97 kB
NPM Version
2.15.9
Node Version
4.6.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-25%
9
Compared to previous month
Last Year
-31.1%
131
Compared to previous year
canvg is a SVG parser and renderer. It takes a URL to a SVG file or the text of an SVG file, parses it in JavaScript, and renders the result on a Canvas element. The rendering speed of the examples is about as fast as native SVG.
The end goal is everything from the SVG spec. The majority of the rendering and animation is working. If you would like to see a feature implemented, don't hesitate to contact me or add it to the issues list.
view here Tested in Chrome, Firefox, Opera, and IE (through FlashCanvas)
Include the following files in your page:
1<script type="text/javascript" src="http://canvg.github.io/canvg/rgbcolor.js"></script> 2<script type="text/javascript" src="http://canvg.github.io/canvg/StackBlur.js"></script> 3<script type="text/javascript" src="http://canvg.github.io/canvg/canvg.js"></script>
Put a canvas on your page
1<canvas id="canvas" width="1000px" height="600px"></canvas>
Example canvg calls:
1<script type="text/javascript"> 2window.onload = function() { 3 //load '../path/to/your.svg' in the canvas with id = 'canvas' 4 canvg('canvas', '../path/to/your.svg') 5 6 //load a svg snippet in the canvas with id = 'drawingArea' 7 canvg(document.getElementById('drawingArea'), '<svg>...</svg>') 8 9 //ignore mouse events and animation 10 canvg('canvas', 'file.svg', { ignoreMouse: true, ignoreAnimation: true }) 11} 12</script>
The third parameter is options:
You can call canvg without parameters to replace all svg images on a page. See the example.
There is also a built in extension method to the canvas context to draw svgs similar to the way drawImage works:
1var c = document.getElementById('canvas'); 2var ctx = c.getContext('2d'); 3ctx.drawSvg(SVG_XML_OR_PATH_TO_SVG, dx, dy, dw, dh);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
project is fuzzed
Details
Reason
packaging workflow detected
Details
Reason
Found 4/23 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
72 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More