# tesseract-html

> A simple HTML templating language for Javascript

Latest version **0.1.7** (published 2018-09-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install tesseract-html
pnpm add tesseract-html
yarn add tesseract-html
bun add tesseract-html
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2018-09-05 |
| First published | 2018-03-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 69.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael Nesto |
| Maintainers | gr1ml0ck |

## Links

- npm: https://www.npmjs.com/package/tesseract-html
- Repository: https://github.com/GR1ML0CK/tesseract-html
- Homepage: https://github.com/GR1ML0CK/tesseract-html#readme
- Issues: https://github.com/GR1ML0CK/tesseract-html/issues
- npm.io page: https://npm.io/package/tesseract-html

## Recent versions

- 0.1.7 (latest) — 2018-09-05
- 0.1.6 — 2018-03-23
- 0.1.5 — 2018-03-23
- 0.1.4 — 2018-03-23
- 0.1.3 — 2018-03-23
- 0.1.2 — 2018-03-23
- 0.1.1 — 2018-03-23
- 0.1.0 — 2018-03-23

## README

# tesseract-html

a simple html builder written in typescript. With this you can write html markup without having to write
markup. This project has no dependencies and will generate valid DOM elements with vanilla javascript alone.

## Example Usage
```typescript
import { div, img, p } from "tesseract-html/dist";

div({
    className: "block",
    id: "a-very-unique-id",
    aria: {
      hidden: "false"
    }
  },
  div({
      className: "block__element",
      data: {
        visible: true,
        "has-image": true
      }
    },
    img({
      src: "http://i0.kym-cdn.com/entries/icons/original/000/012/748/circle.jpg",
      alt: "some kind of image"
    }),
    p({ textContent: "This is some kind of image" })
  )
);

```

Elements can be nullable or undefined allowing you to write blocks like this


```typescript
const test = (condition: boolean) => {
  if (condition) return div();
  return null;
}

div({}, test(true)); // renders 2 nested divs.
div({}, test(false)); // no problem. renders a single div

```

---
_Source: https://npm.io/package/tesseract-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
