Socket
Socket
Sign inDemoInstall

html-to-plastiq

Package Overview
Dependencies
29
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-to-plastiq

Converts an HTML string to a plastiq render function


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Install size
956 kB
Created
Weekly downloads
 

Readme

Source

html-to-plastiq

Converts an html string to a plastiq render function

Example

Input

html
<html>
  <head>
    <meta charset="utf-8">
    <title>My App</title>
  </head>
  <body>
    <h1>Home</h1>
    <div class="container">
      <h2>Lorem ipsum dolor sit amet</h2>
      <ul class="generic-list">
        <li class="item">Lorem ipsum dolor sit amet.</li>
        <li class="item">Laboriosam quaerat sapiente minima nam!</li>
        <li class="item">Incidunt vitae quae facere !</li>
        <li class="item">Tenetur laborum quod cum !</li>
      </ul>
    </div>
  </body>
</html>
var convertToPlastiq = require('html-to-plastiq');
convertToPlastiq(html);

Output

function render() {
  return h("html",
    h("head",
      h("meta", {"attributes":{"charset":"utf-8"}}),
      h("title", "My App")),
    h("body",
      h("h1", "Home"),
      h("div.container",
        h("h2", "Lorem ipsum dolor sit amet"),
        h("ul.generic-list",
          h("li.item", "Lorem ipsum dolor sit amet."),
          h("li.item", "Laboriosam quaerat sapiente minima nam!"),
          h("li.item", "Incidunt vitae quae facere !"),
          h("li.item", "Tenetur laborum quod cum !")))))
};

install

npm

npm install html-to-plastiq

Keywords

FAQs

Last updated on 20 May 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc