Skip to content
Riot.js node Server Side Rendering
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src updated: dependencies and clean up a bit the code Jun 4, 2019
test updated: dependencies and clean up a bit the code Jun 4, 2019
.eslintrc First commit Feb 21, 2019
.gitignore render input value property as html attribute May 26, 2019
.travis.yml added: travis setup May 1, 2019
LICENSE updated: titles May 1, 2019
package-lock.json 4.1.0 Jun 4, 2019
package.json 4.1.0 Jun 4, 2019


Riot module to render riot components on the server

Build Status

NPM version NPM downloads MIT License


npm i -S riot @riotjs/compiler @riotjs/ssr


render - to render only markup

You can simply render your components markup as it follows:

import MyComponent from './my-component.riot'
import render from '@riotjs/ssr'

const html = render('my-component', MyComponent, { some: 'initial props' })

fragments - to render html and css

You can also extract the rendered html and css separately using the fragments function:

import MyComponent from './my-component.riot'
import {fragments} from '@riotjs/ssr'

const {html, css} = fragments('my-component', MyComponent, { some: 'initial props' })

register - to load riot components in node

If you only want load your components source code in a node environement you just need to register the riot loader hook:

import register from '@riotjs/ssr/register'

import MyComponent from './my-component.riot' // It will fail

// from now on you can load `.riot` tags in node
const unregister = register()

import MyComponent from './my-component.riot' // it works!

// normally you will not need to call this function but if you want you can unhook the riot loader
You can’t perform that action at this time.