
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@tsofist/webshot
Advanced tools
Быстрый, а главное эффективный, способ "сфотографировать" веб-страницу.
file:)pdf, png, jpegПод капотом electron
npm i @tsofist/webshot --save --production
import { startupShooter } "webshot";
const myShooter = startupShooter();
/**
* Page from URL to binary Buffer
*/
function shotPageByURLToBinaryBuffer(url: string, format: ShotFormat): Promise<Buffer> {
return myShooter
.then((shooter) => shooter.shotURL(format, url));
}
/**
* Page from URL to local file
*/
function shotPageByURLToFile(url: string, format: ShotFormat, filename: string): Promise<string> {
return myShooter
.then((shooter) => shooter.shotURL(format, url, filename));
}
/**
* Page from URL to stream (e.g. Express.Response)
*/
function shotPageByURLToStream(url: string, format: ShotFormat, destination: NodeJS.WritableStream): Promise<NodeJS.WritableStream> {
return myShooter
.then((shooter) => shooter.shotURL(format, url, destination));
}
И это не все! Можно проделать тоже самое но с html!
import { startupShooter } "webshot";
const myShooter = startupShooter();
/**
* Page as HTML-string to binary Buffer
*/
function shotHTMLToBinaryBuffer(url: string, format: ShotFormat): Promise<Buffer> {
return myShooter
.then((shooter) => shooter.shotHTML(format, url));
}
/**
* Page as HTML-string to local file
*/
function shotHTMLURLToFile(url: string, format: ShotFormat, filename: string): Promise<string> {
return myShooter
.then((shooter) => shooter.shotHTML(format, url, filename));
}
/**
* Page as HTML-string to stream (e.g. Express.Response)
*/
function shotHTMLURLToStream(url: string, format: ShotFormat, destination: NodeJS.WritableStream): Promise<NodeJS.WritableStream> {
return myShooter
.then((shooter) => shooter.shotHTML(format, url, destination));
}
Как только вам надоест потребность в конверторе иссякнет, его можно остановить, либо уничтожить вовсе.
// soft
myShooter.shutdown(() => console.log("Shooter is shutted down"));
// hard
myShooter.halt();
Формат можно описывать следующим образом:
// PDF
{
type: "pdf",
marginsType?: 0 // default
|1 // no
|2; // minimum
pageSize?: "Legal"
|"Letter"
|"Tabloid"
|"A3"|"A4"|"A5"
|{ height: number; width: number; };
printBackground?: boolean; // false by default
landscape?: boolean; // false by default
}
// PNG
{
type: "png",
scaleFactor?: number;
}
// JPEG
{
type: "jpeg",
quality: number;
}
FAQs
A quick and effective way to shoot web pages
The npm package @tsofist/webshot receives a total of 0 weekly downloads. As such, @tsofist/webshot popularity was classified as not popular.
We found that @tsofist/webshot 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.