An open API service indexing awesome lists of open source software.

https://github.com/badoo/dust2jsx

Convert Dust.js templates to JSX
https://github.com/badoo/dust2jsx

Last synced: 11 months ago
JSON representation

Convert Dust.js templates to JSX

Awesome Lists containing this project

README

          

# dust2jsx

> Create JSX code from Dust template

```html

{@Logo name="foo" shadow="true"/}

{?title}

{title}


{/title}

{#images}

{/images}
```

### ➡️

```js

{title ?

{title}


: null}

{images.map(item =>

)}
```

## Usage

```js
const dust2jsx = require('dust2jsx');

dust2jsx('');
// Outputs:
```

### Parameters

#### `externals`
(Boolean)

Outputs array of found referenced variables or Components. Optional. Default: `false`
```js
dust2jsc('', { externals: true });
// Outputs: ['Logo', 'Foo']
```