Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Convert PNG to ICO in memory
$ npm install --save to-ico
const fs = require('fs');
const toIco = require('to-ico');
const files = [
fs.readFileSync('unicorn-16x16.png'),
fs.readFileSync('unicorn-32x32.png')
];
toIco(files).then(buf => {
fs.writeFileSync('favicon.ico', buf);
});
Type: Array
string
Array of PNG image buffers.
The images must have a size of 16x16
, 24x24
, 32x32
, 48x48
, 64x64
, 128x128
or 256x256
and they must have an 8 bit per sample (channel) bit-depth (on Unix you can check this with the file
command: RGB(A) is supported, while colormap is not, because it's 8 bits per pixel instead of 8 bits per channel, which is 24 or 32 bits per pixel depending on the presence of the alpha channel). These are limitations in the underlying pngjs
library. If you have a colormap PNG you can convert it to an RGB/RGBA PNG with commonly used image editing tools.
Type: boolean
Default: false
Use the largest image and resize to sizes defined using the sizes option.
Type: Array
Default: [16, 24, 32, 48, 64, 128, 256]
Array of sizes to use when resizing.
MIT © Kevin Martensson
FAQs
Convert PNG to ICO in memory
We found that to-ico demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.