Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.04 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.04 KB

deno_html

tag Build Status license

Useful template literal tags for create html/css strings in ES2015+.

Usage

import { html } from "https://deno.land/x/html/mod.ts";

let languages = ["Rust", "JavaScript", "TypeScript"];

const str = html`
  <div class="list">
    <ul>
      ${languages.map((x) => `<li>${x}</li>`)}
    </ul>
  </div>
`;

console.log(str);

Outputs:

<div class="list">
  <ul>
    <li>Rust</li>
    <li>JavaScript</li>
    <li>TypeScript</li>
  </ul>
</div>

Why not template literal?

License

deno_html is released under the MIT License. See the bundled LICENSE file for details.