Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

minipug

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minipug

Extract LLM-friendly representation of a webpage

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
0
Created
Source

minipug

Extract LLM-friendly representation of the DOM in Pug format.

Install

npm i -s minipug

Usage

import MiniPug from 'minipug'
const minipug = new MiniPug(document)
const pug = minipug.convert()

Example

Input:

<html>
  <head>
    <title>Example Domain</title>
    <meta charset="utf-8">
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type="text/css">
      body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
      }
    </style>    
  </head>
  <body>
    <h1>Hello World</h1>
    <section class="example-section">
      <p>This is an example.</p>
      <button aria-label="Next page" class="z2iX5wAef9nHv">Next page</button>
    </section>
  </body>
</html>

Output:

h1 Hello World
section 
  p This is an example.
  button(aria-label="Next page") Next page

FAQs

Package last updated on 14 Mar 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