https://github.com/dumbjs/arrow-render-to-string
Render ArrowJS templates and partials to string. (Deno, Node, Bun, Browser)
https://github.com/dumbjs/arrow-render-to-string
arrow-js arrowjs browser bun deno node render-to-string ssr
Last synced: about 2 months ago
JSON representation
Render ArrowJS templates and partials to string. (Deno, Node, Bun, Browser)
- Host: GitHub
- URL: https://github.com/dumbjs/arrow-render-to-string
- Owner: dumbjs
- License: mit
- Created: 2023-10-18T22:59:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-17T07:12:56.000Z (6 months ago)
- Last Synced: 2026-03-06T22:50:46.742Z (3 months ago)
- Topics: arrow-js, arrowjs, browser, bun, deno, node, render-to-string, ssr
- Language: JavaScript
- Homepage:
- Size: 652 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


Render [ArrowJS](http://arrow-js.com) templates and partials to string.
Works wherever JS does.
## Installation
```bash
npm install arrow-render-to-string
```
## Usage/Examples
### Basic
```javascript
import { html } from '@arrow-js/core'
import { renderToString } from 'arrow-render-to-string'
const message = 'Hello World'
const view = html`
${message}
`
renderToString(view) //=>
Hello World
```
### Reactive Variables
```javascript
import { html, reactive } from '@arrow-js/core'
import { renderToString } from 'arrow-render-to-string'
const state = reactive({
count: 0,
})
const view = html`
${() => state.count}
`
renderToString(view) //=>
0
```
### Events
Events are stripped out, for you to re-hydrate on the client
```javascript
import { html, reactive } from '@arrow-js/core'
import { renderToString } from 'arrow-render-to-string'
const state = reactive({
count: 0,
})
const view = html` (state.count += 1)}">
${() => state.count}
`
renderToString(view) //=> ">0
```
## License
[MIT](/LICENSE)