# hogan.jsx

> Hogan templating engine for JSX.

Latest version **0.1.2** (published 2014-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install hogan.jsx
pnpm add hogan.jsx
yarn add hogan.jsx
bun add hogan.jsx
```

## 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.2 |
| Published | 2014-04-10 |
| First published | 2013-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | shibukawa |
| Maintainers | shibu |
| Keywords | jsx, lib, template, mustache |

## Links

- npm: https://www.npmjs.com/package/hogan.jsx
- Repository: https://github.com/shibukawa/hogan.jsx
- Issues: https://github.com/shibukawa/hogan.jsx.git/issues
- npm.io page: https://npm.io/package/hogan.jsx

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-04-10
- 0.1.1 — 2014-02-23
- 0.1.0 — 2013-09-30

## README

hogan.jsx
===========================================

Synopsis
---------------

This is a [JSX](http://jsx.github.io/) version of JavaScript templating library [Hogan](http://twitter.github.io/hogan.js/).
Original Hogan and this Hogan.jsx implement [Mustache](http://mustache.github.io/) template syntax.
You can read detail syntax at [here](http://mustache.github.io/mustache.5.html).

This project is aming following features:

* Genrerate JS Function object
* Genrerate JSX script from Mustache formating templates (not tested yet).

Code Example
---------------

```js
import "console.jsx";
import "hogan.jsx";

class _Main {
    static function main (argv : string[]) : void
    {
        var data = {
            weather: "a sunny day!",
        } : variant;

        var template = Hogan.compile("Today's weather is {{weather}}");
        var output = template.render(data);
        // prints "Today's wheather is a sunny day!"
        console.log(output);
    }
}
```

Installation
---------------

```sh
$ npm install hogan.jsx
```

API Reference
------------------

* `static Hogan.compile(src : string) : Template`

  Generate Template object.   

* `static Hogan.compileToJSX(src : string) : string`

  Generate Template instance source code in JSX.

* `Template.render(context : variant) : string`

  Generate converted text.

Development
-------------

## Repository

* Repository: git://github.com/shibukawa/hogan.jsx.git
* Issues: https://github.com/shibukawa/hogan.jsx.git/issues

## Run Test

```sh
$ grunt test
```

## Build

```sh
# Generate API reference
$ grunt doc

# Build application or library for JS project
$ grunt build
```

Author
---------

* Yoshiki Shibukawa / yoshiki@shibu.jp

License
------------

MIT

Complete license is written in `LICENSE.md`.

Original License
----------------

Copyright 2011 Twitter, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

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