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.
node-base64-image
Advanced tools
Download images from remote URLs and encode/decode them to base64
Download images from remote URLs or use local images and encode/decode them to Base64 string or Buffer object
npm i node-base64-image --save
const base64 = require('node-base64-image');
// or
import {encode, decode} from 'node-base64-image';
// encoding a remote jpg to base64
const url = 'https://example.com/test.jpg';
const options = {
string: true,
headers: {
"User-Agent": "my-app"
}
};
const image = await encode(url, options);
// encoding a local file
const localUrl = 'C:/project/test.jpg';
const localImage = await encode(url, {string: true, local: true});
// writing to file named 'example.jpg'
await decode(image, { fname: 'example', ext: 'jpg' });
// writing to a sub-directory
// after creating a directory called 'photos'
const image = await encode(url, options);
await decode(image, { fname: './photos/example', ext: 'jpg' });
Read the CONTRIBUTING guide for information.
Licensed under MIT. See LICENSE for more information.
Report a bug in issues.
Made with love in Dhaka, Bangladesh by Riyadh Al Nur
FAQs
Download images from remote URLs and encode/decode them to base64
The npm package node-base64-image receives a total of 6,954 weekly downloads. As such, node-base64-image popularity was classified as popular.
We found that node-base64-image demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.