# linjar

> Render JSX to an HTML/XML string

Latest version **1.0.3** (published 2023-08-13) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-08-13 |
| First published | 2020-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | toga4 |
| Maintainers | clomie |

## Links

- npm: https://www.npmjs.com/package/linjar
- Repository: https://github.com/toga4/linjar
- Issues: https://github.com/toga4/linjar/issues
- npm.io page: https://npm.io/package/linjar

## Recent versions

- 1.0.3 (latest) — 2023-08-13
- 1.0.2 — 2020-11-10
- 1.0.1 — 2020-11-10
- 1.0.0 — 2020-11-10

## README

# linjar

The lightweight templating engine that renders HTML/XML from JSX.

----

## Render JSX to HTML

```tsx
/* @jsx h */
import { h, render } from 'linjar'

const node = <div class="foo">bar</div>
const html = render(node)
console.log(html)
// <div class="foo">bar</div>
```

## Use Component and Fragment

```tsx
/* @jsx h */
import { h, render, Component, ChildNodes, Fragment } from 'linjar'

type FooProps = {
  bar: string
  children?: ChildNodes
}
const Foo: Component<FooProps> = ({ bar, children }) => (
  <Fragment>
    <span class={bar}>foo</span>
    {children}
    <span class={bar}>bar</span>
  </Fragment>
)

const node = (
  <div>
    <Foo bar={'baz'}>
      <span>hello</span>
    </Foo>
  </div>
)
const html = render(node)
console.log(html)
// <div><span class="baz">foo</span><span>hello</span><span class="baz">bar</span></div>
```

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