# microh

> a small and simple hyperscript helper

Latest version **0.1.0** (published 2019-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install microh
pnpm add microh
yarn add microh
bun add microh
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-11-06 |
| First published | 2019-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Daniel Loomer |
| Maintainers | fuzetsu |
| Keywords | hyperscript, vdom, react, hyperapp, preact |

## Links

- npm: https://www.npmjs.com/package/microh
- Repository: https://github.com/fuzetsu/microh
- Homepage: https://github.com/fuzetsu/microh#readme
- Issues: https://github.com/fuzetsu/microh/issues
- npm.io page: https://npm.io/package/microh

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-11-06
- 0.0.4 — 2019-09-06
- 0.0.3 — 2019-08-24
- 0.0.2 — 2019-06-25
- 0.0.1 — 2019-06-25

## README

# `microh` [![npm](https://img.shields.io/npm/v/microh.svg)](https://www.npmjs.com/package/microh) [![size](https://img.badgesize.io/https://unpkg.com/microh@latest/dist/microh.min.js.png?label=gzip&color=blue&compression=gzip)](https://unpkg.com/microh@latest/dist/microh.min.js)

A small and simple hyperscript wrapper for vdom libraries such as (but not limited to) Preact, React, and Hyperapp.

## Features

- optional attrs `h('h1', 'Hello World')`
- inline classNames `h('button.button.is-primary')`
- no tag name means div `h('.login-area')`
- varargs `h('div', 'Hello', 'World', 'the time is', Date.now())`

```js
import { h, render } from 'preact'
import microh from 'microh'

// create a wrapped instance of h by passing it to microh
const m = microh(h)

const vnode = m('ul.list-style',
  m('li', 'one'),
  m('li', 'two'),
  m('li', 'three'),
  m('li', 'four')
)

render(vnode, document.body)
```

[playground](https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4IWAA60ATsQAEwOYQpzpTACYxpc1nLDTaWOQHIJajNWLGAOmnFTZcrBGoHCeg0ePPXtQjbRbAHoguVcYDEY5DDkAd2kMCQkYdTkINDhiDDRqGDlaMCU5ACMATzkJDDg4dIBzNPliWicXN1shTKc5AF4W30IACkIASlt2+k6ANzRaTR6nAeMAVyh8KAhMgFpM0thjFVs5BeN1-ZN6GGNhikPj05VjYljaK5u0I6xF+5NiQjVL663T4nCBnYxgWhLaRXWyjQJoNRoTTSAbTWYwFTqWjUJY4Bj4YqzUrDSggOAwWCWCATPAARgAzIgAEwADjYHBAmBweHw1GqpKEjGYPDYAF1WEA)

## Installation

### esm modules

```js
import microh from 'https://unpkg.com/microh?module'
```

### Browser

```html
<script src="https://unpkg.com/microh"></script>
<script>
  window.microh
</script>
```

### NodeJS

```js
// npm install microh
const microh = require('microh')
```

## Usage

**[React](https://github.com/facebook/react)**

```js
import React from 'react'
import microh from 'microh'

const m = microh(React.createElement)
```

**[Preact](https://github.com/preactjs/preact)**

```js
import { h } from 'preact'
import microh from 'microh'

const m = microh(h)
```

**[Hyperapp](https://github.com/JorgeBucaran/hyperapp)**

```js
import { h } from 'hyperapp'
import microh from 'microh'

const m = microh(h)
```

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