Socket
Book a DemoInstallSign in
Socket

@soymaycol/mayhtml

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soymaycol/mayhtml

Módulo para capturar screenshots de HTML usando CatBox y NightAPI

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

MayHTML 📸

Un módulo de Node.js que captura screenshots de contenido HTML usando CatBox y NightAPI.

🔧 Instalación

npm install mayhtml

📖 Uso Básico

Capturar HTML directo

const MayHTML = require('mayhtml');

const mayhtml = new MayHTML();

const htmlContent = `
<!DOCTYPE html>
<html>
<head>
    <title>Mi Página</title>
    <style>
        body { 
            font-family: Arial; 
            background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
            padding: 40px;
        }
    </style>
</head>
<body>
    <h1>¡Hola Mundo!</h1>
    <p>Este HTML será capturado como imagen</p>
</body>
</html>
`;

async function capturar() {
    try {
        const rutaImagen = await mayhtml.captureHTML(
            htmlContent,
            './screenshots/',  // Directorio de descarga
            'mi-captura'       // Nombre del archivo
        );
        
        console.log('Imagen guardada en:', rutaImagen);
    } catch (error) {
        console.error('Error:', error.message);
    }
}

capturar();

Capturar desde archivo HTML

const mayhtml = new MayHTML();

async function capturarArchivo() {
    try {
        const rutaImagen = await mayhtml.captureFromFile(
            './mi-pagina.html',    // Archivo HTML
            './capturas/',         // Directorio de descarga
            'captura-especial'     // Nombre personalizado
        );
        
        console.log('Captura guardada:', rutaImagen);
    } catch (error) {
        console.error('Error:', error.message);
    }
}

capturarArchivo();

Hecho ️por SoyMaycol con ♥ para la comunidad de desarrolladores

Keywords

html

FAQs

Package last updated on 13 Jun 2025

Did you know?

Socket

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.

Install

Related posts