Skip to main content
Deno 2 is finally here 🎉️
Learn more

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.