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.
puppeteer-html-image
Advanced tools
Generate images from HTML and take screenshots from URLs using Puppeteer and puppeteer core
A Node.js package to convert HTML to image and URL to screenshot using Puppeteer and Puppeteer Cluster.
Install the package via npm:
npm install puppeteer-html-image
import { htmlToImage, urlToImage } from "puppeteer-html-image";
// Convert HTML to Image
const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<title>Example HTML</title>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 0; }
.container { padding: 20px; }
h1 { color: #333; }
</style>
</head>
<body>
<div class="container">
<h1>Hello, World!</h1>
<p>This is an example HTML content rendered by Puppeteer.</p>
</div>
</body>
</html>
`;
htmlToImage(htmlContent, "html-screenshot.png");
// Convert URL to Image
urlToImage("https://example.com", "url-screenshot.png");
htmlToImage(htmlContent
: string, outputPath: string): Promise`
Converts the provided HTML content to an image and saves it to the specified output path.
htmlContent
: The HTML content to be rendered.
outputPath
: The path where the screenshot will be saved.
urlToImage(url: string, outputPath: string): Promise<void>
Takes a screenshot of the specified URL and saves it to the specified output path.
url
: The URL to be rendered.
outputPath
: The path where the screenshot will be saved.
website: [https://subodha-protofolio-personal.netlify.app/]
Github: SubodhaSahu
FAQs
Generate images from HTML and take screenshots from URLs using Puppeteer and puppeteer core
The npm package puppeteer-html-image receives a total of 13 weekly downloads. As such, puppeteer-html-image popularity was classified as not popular.
We found that puppeteer-html-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.