html2jsonconvertor

1.0.3 • Public • Published

HTML to JSON Converter

Description

This is a JavaScript program that converts HTML code to a JSON object.

Table of Contents

Installation

You can install this program using npm or yarn:

npm install html2jsonconvertor

or

yarn add html2jsonconvertor

Usage

To use the HTML to JSON converter, you can do the following:

const parseHTML = require("html2jsonconvertor");

const html = `
    <div style="background-color: yellow; font-size: 14px" id="first-div"> 
        Hello, friends 
        <p class="para" style="font-faimly: monospace; font-size: 11px"> Lorem ipsum dolor sit </p>
        <footer style="width: auto; height: 100px; color: blue"> <span> This is the end </span> </footer>
    </div>`;
const json = parseHTML(html);

console.log(json);

CLI & Browser Integration

  • CLI (index.js)
  • Browser (server.js)

/html2jsonconvertor/

    Package Sidebar

    Install

    npm i html2jsonconvertor

    Weekly Downloads

    2

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    6.16 kB

    Total Files

    8

    Last publish

    Collaborators

    • jannydream