estml

0.0.1 • Public • Published

ES TML

Render html ES6 way :)
npm package JavaScript Style Guide

Install

npm i estml

Usage

const T = require('estml')

Simple tag with no attribute

T('br')

toString result

<br>

Simple tag with attribute

T('span', {class: 'foo'})

toString result

<span class="foo"></span>

Simple tag with inner html

T('h1')`TITLE!`

result

<h1>TITLE!</h1>

Self closing tag

T('foo-component/')

toString result

<foo-component/>

Mixed example

T('div')`
  ${T('input', {type: 'text', class: 'foo'})}
  Foo Text${T('br')}
  ${T('div')`
    inside div
    ${T('foo-component/')}
  `}
`

result

<div>
  <input type="text" class="foo">
  Foo Text<br>
  <div>
    inside div
    <foo-component/>
  </div>
</div>

What is the benefit of using this?

Nothing.

Just read the code and have fun :)

Readme

Keywords

Package Sidebar

Install

npm i estml

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • elevista