New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

html2jsonconvertor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html2jsonconvertor

A tool for converting HTML to JSON.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

HTML to JSON Converter

Description

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

Table of Contents

  • Installation
  • Usage
  • Examples
  • Contributing
  • License

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)

Keywords

HTML

FAQs

Package last updated on 07 Sep 2023

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