Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-to-plastiq

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-plastiq

Converts an HTML string to a plastiq render function

  • 1.0.1
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

html-to-plastiq

Converts an html string to a plastiq render function

Example

Input

var convertToPlastiq = require('html-to-plastiq');
var htmlString ="<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>";

convertToPlastiq(htmlString);

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

Package last updated on 20 May 2016

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc