@sharyn/util.html
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

🌹 html

html is a template string tag that does almost nothing. It's a normal template string, but your code editor or its plugins might support syntax highlighting for HTML when they are marked with an html tag. The only thing it does is to .trim() your string so that you can put your template string on multiple lines without getting unwanted whitespace before the doctype or after the final html tag.

import html from '@sharyn/util/html'
// or import { html } from '@sharyn/util'

const createHtml = ({ title }: { title: string }) =>
  html`
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <title>${title}</title>
      </head>
      <body>
        <h1>${title}</h1>
      </body>
    </html>
  ` // This HTML code has syntax highlighting

html is part of @sharyn/util

Readme

Keywords

none

Package Sidebar

Install

npm i @sharyn/util.html

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

3.06 kB

Total Files

6

Last publish

Collaborators

  • sharyn