Gathering detailed insights and metrics for blueimp-canvas-to-blob-global
Gathering detailed insights and metrics for blueimp-canvas-to-blob-global
Gathering detailed insights and metrics for blueimp-canvas-to-blob-global
Gathering detailed insights and metrics for blueimp-canvas-to-blob-global
JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.
npm install blueimp-canvas-to-blob-global
Typescript
Module System
Node Version
NPM Version
69.4
Supply Chain
99.3
Quality
75.1
Maintenance
100
Vulnerability
100
License
JavaScript (91.01%)
HTML (7.01%)
Shell (1.98%)
Total Downloads
34,417
Last Day
21
Last Week
58
Last Month
318
Last Year
11,159
MIT License
1,475 Stars
151 Commits
395 Forks
66 Watchers
2 Branches
8 Contributors
Updated on May 04, 2025
Minified
Minified + Gzipped
Latest Version
3.29.1
Package Id
blueimp-canvas-to-blob-global@3.29.1
Unpacked Size
14.63 kB
Size
5.59 kB
File Count
6
NPM Version
6.14.12
Node Version
12.22.1
Cumulative downloads
Total Downloads
Canvas to Blob is a polyfill for Browsers that don't support the standard JavaScript HTMLCanvasElement.toBlob method.
It can be used to create Blob objects from an HTML canvas element.
Install via NPM:
1npm install blueimp-canvas-to-blob
This will install the JavaScript files inside
./node_modules/blueimp-canvas-to-blob/js/
relative to your current directory,
from where you can copy them into a folder that is served by your web server.
Next include the minified JavaScript Canvas to Blob script in your HTML markup:
1<script src="js/canvas-to-blob.min.js"></script>
Or alternatively, include the non-minified version:
1<script src="js/canvas-to-blob.js"></script>
You can use the canvas.toBlob()
method in the same way as the native
implementation:
1var canvas = document.createElement('canvas') 2// Edit the canvas ... 3if (canvas.toBlob) { 4 canvas.toBlob(function (blob) { 5 // Do something with the blob object, 6 // e.g. create multipart form data for file uploads: 7 var formData = new FormData() 8 formData.append('file', blob, 'image.jpg') 9 // ... 10 }, 'image/jpeg') 11}
The JavaScript Canvas to Blob function has zero dependencies.
However, it is a very suitable complement to the JavaScript Load Image function.
The following browsers have native support for HTMLCanvasElement.toBlob:
Browsers which implement the following APIs support canvas.toBlob()
via
polyfill:
This includes the following browsers:
In addition to the canvas.toBlob()
polyfill, the JavaScript Canvas to Blob
script exposes its helper function dataURLtoBlob(url)
:
1// Uncomment the following line when using a module loader like webpack: 2// var dataURLtoBlob = require('blueimp-canvas-to-blob') 3 4// black+white 3x2 GIF, base64 data: 5var b64 = 'R0lGODdhAwACAPEAAAAAAP///yZFySZFySH5BAEAAAIALAAAAAADAAIAAAIDRAJZADs=' 6var url = 'data:image/gif;base64,' + b64 7var blob = dataURLtoBlob(url)
The JavaScript Canvas to Blob script is released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-05-05
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 MoreLast Day
0%
21
Compared to previous day
Last Week
31.8%
58
Compared to previous week
Last Month
-15.2%
318
Compared to previous month
Last Year
-39.5%
11,159
Compared to previous year