# viperHTML
**Repository Path**: mirrors_WebReflection/viperHTML
## Basic Information
- **Project Name**: viperHTML
- **Description**: Isomorphic hyperHTML
- **Primary Language**: Unknown
- **License**: ISC
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-19
- **Last Updated**: 2025-12-27
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# viperHTML
[](https://github.com/WebReflection/donate) [](https://opensource.org/licenses/ISC) [](https://travis-ci.org/WebReflection/viperHTML) [](https://coveralls.io/github/WebReflection/viperHTML?branch=master)  [](https://greenkeeper.io/)
## Warning
Due [low popularity](https://www.npmjs.com/package/viperhtml) of this project after all these years, and because I have shifted focus to better alternatives, this **project is currently in maintenance mode**, meaning that 100% _feature parity_ with _hyperHTML_ is not anymore an achievement, and only the simple/obvious will be fixed.
Among various changes happened to _hyperHTML_, the **sparse attributes** will likely **not** be **supported**, as the refactoring needed here would easily outperform the benefits.
As _sparse attributes_ are never really been a must have, you can simply use `attr=${...}` and concatenate in there anything you want.
This is also true for most modern alternatives of mine, such as [ucontent](https://github.com/WebReflection/ucontent#readme), but if that's the only deal breaker, have a look at [heresy-ssr](https://github.com/WebReflection/heresy-ssr#readme), which is 1:1 based on [lighterhtml](https://github.com/WebReflection/lighterhtml#readme), hence likely always 100% in features parity with it, included sparse attributes.
- - -
[hyperHTML](https://github.com/WebReflection/hyperHTML) lightness, ease, and performance, for the server.
- - -
Don't miss the [viperHTML](https://github.com/WebReflection/viperHTML) version of **Hacker News**
Live: https://viperhtml-164315.appspot.com/
Repo: https://github.com/WebReflection/viper-news
- - -
### Similar API without DOM constrains
Similar to its browser side counterpart, `viperHTML` parses the template string once, decides what is an attribute, what is a callback, what is text and what is HTML, and any future call to the same render will only update parts of that string.
The result is a blazing fast template engine that makes templates and renders shareable between the client and the server.
### Seamlessly Isomorphic
No matter if you use ESM or CommonJS, you can use [hypermorphic](https://github.com/WebReflection/hypermorphic#hypermorphic-)
to load same features on both client and server.
```js
// ESM example (assuming bundlers/ESM loaders in place)
import {bind, wire} from 'hypermorphic';
// CommonJS example
const {bind, wire} = require('hypermorphic');
```
### Automatically Sanitized HTML
Both attributes and text nodes are safely escaped on each call.
```js
const viperHTML = require('viperhtml');
var output = render => render`
${a.text}
${[a.html]}
`;
var a = {
text: 'Click "Me"',
html: '"HTML" Me',
href: 'https://github.com/WebReflection/viperHTML',
onclick: (e) => e.preventDefault()
};
// associate the link to an object of info
// or simply use viperHTML.wire();
var link = viperHTML.bind(a);
console.log(output(link).toString());
```
The resulting output will be the following one:
```html
Click "Me"
"HTML" Me
```
### Usage Example
```js
const viperHTML = require('viperhtml');
function tick(render) {
return render`