You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

svg-to-ico

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-to-ico - npm Package Compare versions

Comparing version

to
1.0.16

6

package.json
{
"name": "svg-to-ico",
"version": "1.0.15",
"version": "1.0.16",
"description": "Utility that translates an SVG Image to a .ico format",

@@ -28,7 +28,7 @@ "main": "svg-to-ico.js",

"ico-endec": "^0.1.6",
"sharp": "^0.32.4"
"sharp": "^0.34.1"
},
"devDependencies": {
"eslint": "^8.45.0"
"eslint": "^9.26.0"
}
}

@@ -8,5 +8,6 @@ const fs = require("fs");

*
* @param {string} config.input_name Specifies the file name and path for the SVG input file.
* @param {string=favicon.ico} config.output_name Specifies the name and path for the output .ico file.
* @param {string} config.input_name Specifies the file name and path for the SVG input file
* @param {string} config.output_name Specifies the name and path for the output .ico file
* @param {number[]} config.sizes Specifies the array of sizes to include in the packaged .ico file
* @param {number} config.compression_level Specifies the compression level (0-9) to use with PNG conversions
*/

@@ -16,5 +17,9 @@ async function svg_to_ico({

output_name = "favicon.ico",
sizes = [ 16, 32, 48, 64, 128, 256 ]
sizes = [ 16, 32, 48, 64, 128, 256 ],
compression_level = 1,
})
{
if (!Number.isInteger(compression_level) || compression_level < 0 || compression_level > 9) {
throw new Error(`invalid compression_level '${compression_level}'`);
}
return new Promise(function(accept, reject) {

@@ -25,3 +30,3 @@ const output_promises = sizes.map((size) => {

resize(size, size, {fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).
png({ compressionLevel: 0 }).
png({ compressionLevel: compression_level }).
toBuffer().

@@ -41,2 +46,2 @@ then((buffer) => { image_accept(buffer); }).

module.exports = svg_to_ico;
module.exports = svg_to_ico;

Sorry, the diff of this file is not supported yet