@sveltech/ssr

0.0.12 • Public • Published

ssr

Universal SSR renderer

Install

npm i @sveltech/ssr

Usage example

const { ssr } require('@sveltech/ssr')
const fs = require('fs')

const template = fs.readFileSync('./dist/index.html')
const script = fs.readFileSync('./dist/app.js')

ssr(template, script, '/blog/ssr-is-fun')
  .then(html => console.log(html + '<!--ssr rendered-->'))

Important!

The HTML is only rendered after an app-loaded event has been emitted from the app.

dispatchEvent(new CustomEvent('app-loaded'))

For more information, refer to the API documentation. https://github.com/sveltech/ssr/wiki/API

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @sveltech/ssr

    Weekly Downloads

    36

    Version

    0.0.12

    License

    ISC

    Unpacked Size

    5.49 kB

    Total Files

    4

    Last publish

    Collaborators

    • jakobrosenberg