# vanilla-jsx-node

> JSX in, HTMLElements out

Latest version **2.0.2** (published 2015-12-24) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install vanilla-jsx-node
pnpm add vanilla-jsx-node
yarn add vanilla-jsx-node
bun add vanilla-jsx-node
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2015-12-24 |
| First published | 2015-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | steelbrain |
| Maintainers | steelbrain |
| Keywords | jsx |

## Links

- npm: https://www.npmjs.com/package/vanilla-jsx-node
- Repository: https://github.com/steelbrain/vanilla-jsx
- Homepage: https://github.com/steelbrain/vanilla-jsx#readme
- Issues: https://github.com/steelbrain/vanilla-jsx/issues
- npm.io page: https://npm.io/package/vanilla-jsx-node

## Dependencies (1)

- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3

## Recent versions

- 2.0.2 (latest) — 2015-12-24
- 2.0.1 — 2015-12-24

## README

Vanilla-JSX-Node
=========

Vanilla-JSX-Node is the node version of the [Vanilla-JSX][1] library. This library allows you to render your
views written for the browser to string, server side.

#### Features

 - Works without any DOM in env
 - Renders JSX to string
 - Translates className attribute into class

#### API

```js
// Responsible for creating HTML Elements from JSX
export function jsx(name, attributes, ...children): Object {}
// To be executed on result from JSX method
export function process(element): string {}

```

#### Example
```js
'use babel'

import vanilla from 'vanilla-jsx-node'
/** @jsx vanilla.jsx */

export class Message {
  constructor(message) {
    this.element = Message.getElement()
    console.log(typeof this.element === 'string')
    // ^ true!
  }
  static getElement(message) {
    return vanilla.process(<div>
      <span>{message.name}</span>
      <span>{message.text}</span>
      <span>{message.filePath}</span>
      {message.trace.map(Message.getElement)}
    </div>)
  }
}
```

#### LICENSE
This project is licensed under the terms of MIT License, See the LICENSE file for more info

[1]:https://github.com/steelbrain/vanilla-jsx

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