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

html2hyperscript

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

html2hyperscript

Convert legacy HTML to Hyperscript (https://github.com/dominictarr/hyperscript)

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Convert Legacy HTML to Hyperscript

Automatically translate old HTML markup into the new Hyperscript markup embeddable directly inside your component Javascript code.

See Hyperscript library: https://github.com/dominictarr/hyperscript

Also useful for virtual DOM Hyperscript-like syntax: https://github.com/Matt-Esch/virtual-dom

HTML goes in:

<table class="sample-html">
  <tr>
    <th>Pandas</th>
    <th>Kittens</th>
    <th>Hedgehogs</th>
  </tr>
  <tr>
    <td>foo</td>
    <td>bar</td>
    <td>baz</td>
  </tr>
  <tr>
    <td>32</td>
    <td>45</td>
    <td>83</td>
  </tr>
  <tr>
    <td>onomatopoeia</td>
    <td>schadenfreude</td>
    <td>antidisestablishmentarianism</td>
  </tr>
</table>

Hyperscript-like JS syntax comes out:

h("table.sample-html", [
  h("tr", [
    h("th", [ "Pandas" ]),
    h("th", [ "Kittens" ]),
    h("th", [ "Hedgehogs" ])
  ]),
  h("tr", [
    h("td", [ "foo" ]),
    h("td", [ "bar" ]),
    h("td", [ "baz" ])
  ]),
  h("tr", [
    h("td", [ "32" ]),
    h("td", [ "45" ]),
    h("td", [ "83" ])
  ]),
  h("tr", [
    h("td", [ "onomatopoeia" ]),
    h("td", [ "schadenfreude" ]),
    h("td", [ "antidisestablishmentarianism" ])
  ])
])

TODO

  • publish NPM package
  • online converter tool

FAQs

Package last updated on 17 Mar 2015

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