0.0.4 • Published 4 months ago

@komefumi/html-template-tag v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Simple HTML Template Tag

A simple utility function. Bundled for different environments using Rollup, and making use of TypeScript.

Usage

First install:

npm install @komefumi/html-template-tag

Usage is as follows:

import html from "simple-html-template-tag";

const interpolated = 450;
const resulted = html`<h1>${interpolated}</h1>`;

The Advantage

You get HTML syntax highlighting, formatting, and everything else that your text editor supports if it recognizes the html tag to mean the associated string to be in HTML. This allows the building of raw HTML strings within JavaScript.

To take advantage of this support (easily provided in VSCode), you have to import the package function as html, as you see in the example above.

i.e.,

import html from "simple-html-template-tag";

And not

import somethingElse from "simple-html-template-tag";

More notes

Partially also a learning project, feel free to use the code as you see fit!

0.0.4

4 months ago

0.0.3

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago