
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@vue/server-renderer
Advanced tools
Note: as of 3.2.13+, this package is included as a dependency of the main vue package and can be accessed as vue/server-renderer. This means you no longer need to explicitly install this package and ensure its version match that of vue's. Just use the vue/server-renderer deep import instead.
renderToStringSignature
function renderToString(
input: App | VNode,
context?: SSRContext,
): Promise<string>
Usage
const { createSSRApp } = require('vue')
const { renderToString } = require('@vue/server-renderer')
const app = createSSRApp({
data: () => ({ msg: 'hello' }),
template: `<div>{{ msg }}</div>`,
})
;(async () => {
const html = await renderToString(app)
console.log(html)
})()
If the rendered app contains teleports, the teleported content will not be part of the rendered string. Instead, they are exposed under the teleports property of the ssr context object:
const ctx = {}
const html = await renderToString(app, ctx)
console.log(ctx.teleports) // { '#teleported': 'teleported content' }
renderToNodeStreamRenders input as a Node.js Readable stream.
Signature
function renderToNodeStream(input: App | VNode, context?: SSRContext): Readable
Usage
// inside a Node.js http handler
renderToNodeStream(app).pipe(res)
Note: This method is not supported in the ESM build of @vue/server-renderer, which is decoupled from Node.js environments. Use pipeToNodeWritable instead.
pipeToNodeWritableRender and pipe to an existing Node.js Writable stream instance.
Signature
function pipeToNodeWritable(
input: App | VNode,
context: SSRContext = {},
writable: Writable,
): void
Usage
// inside a Node.js http handler
pipeToNodeWritable(app, {}, res)
renderToWebStreamRenders input as a Web ReadableStream.
Signature
function renderToWebStream(
input: App | VNode,
context?: SSRContext,
): ReadableStream
Usage
// inside an environment with ReadableStream support
return new Response(renderToWebStream(app))
Note: in environments that do not expose ReadableStream constructor in the global scope, pipeToWebWritable should be used instead.
pipeToWebWritableRender and pipe to an existing Web WritableStream instance.
Signature
function pipeToWebWritable(
input: App | VNode,
context: SSRContext = {},
writable: WritableStream,
): void
Usage
This is typically used in combination with TransformStream:
// TransformStream is available in environments such as CloudFlare workers.
// in Node.js, TransformStream needs to be explicitly imported from 'stream/web'
const { readable, writable } = new TransformStream()
pipeToWebWritable(app, {}, writable)
return new Response(readable)
renderToSimpleStreamRenders input in streaming mode using a simple readable interface.
Signature
function renderToSimpleStream(
input: App | VNode,
context: SSRContext,
options: SimpleReadable,
): SimpleReadable
interface SimpleReadable {
push(content: string | null): void
destroy(err: any): void
}
Usage
let res = ''
renderToSimpleStream(
app,
{},
{
push(chunk) {
if (chunk === null) {
// done
console(`render complete: ${res}`)
} else {
res += chunk
}
},
destroy(err) {
// error encountered
},
},
)
3.5.22 (2025-09-25)
@vue-ignore in runtime type resolution (#13906) (ba7f7f9)PatchFlags.BAIL for slot when props are present (#13907) (5358bca), closes #13904h helper (#13841) (75220c7)forceReflow on the correct document (fix #13849) (#13853) (1be5ddf)never instead of {} (#13915) (8620a61), closes #11564shadowRoot in custom elements (#12965) (47e628d), closes #12964FAQs
@vue/server-renderer
The npm package @vue/server-renderer receives a total of 3,353,372 weekly downloads. As such, @vue/server-renderer popularity was classified as popular.
We found that @vue/server-renderer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.