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
- Host: GitHub
- URL: https://github.com/badoo/dust2jsx
- Owner: badoo
- Created: 2018-05-16T10:50:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T01:32:46.000Z (over 3 years ago)
- Last Synced: 2025-04-06T03:51:04.695Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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']
```