npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sututu/vue

v0.1.0

Published

Vue.js SSR/CSR plugin for Sututu framework

Readme

@sututu/vue

Vue 3 SSR/CSR Fastify plugin for the Sututu framework. Provides hybrid server-side and client-side rendering with minimal configuration.

Features

  • Hybrid SSR/CSR - Server-side rendering with client-side hydration
  • Zero boilerplate - Virtual entry files generated automatically
  • Hot Module Replacement - Full HMR support in development
  • i18n ready - Built-in internationalization with pluralization
  • Error handling - Automatic error boundaries and pages
  • Universal fetch - useFetch works on server and client
  • Head management - useHead for meta tags and SEO

Installation

npm install @sututu/vue

Quick Start

Create three files in your src/client directory:

src/client/
├── App.vue
├── routes.js
└── index.html

App.vue

<template>
  <SututuOutlet />
</template>

routes.js

export default [
  {
    path: '/',
    name: 'home',
    component: () => import('./views/Home.vue')
  }
]

index.html

<!DOCTYPE html>
<html lang="{{lang}}">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{{title}}</title>
  {{meta}}
  {{link}}
</head>
<body>
  <div id="app">{{app}}</div>
  {{state}}
  <script type="module" src="/entry-client.js"></script>
</body>
</html>

Composables

useFetch

Universal data fetching that works on server and client.

import { useFetch } from '@sututu/vue/composables'

const { data, error, pending, refresh } = useFetch('/api/users')

Options:

  • timeout - Request timeout (default: 10s SSR, 30s CSR)
  • lazy - Don't block SSR rendering
// Lazy fetch - loads on client after hydration
const { data } = useFetch('/api/recommendations', { lazy: true })

// Or use the shorthand
import { useLazyFetch } from '@sututu/vue/composables'
const { data } = useLazyFetch('/api/recommendations')

useHead

Manage document head for SEO.

import { useHead } from '@sututu/vue/composables'

useHead({
  title: 'My Page',
  meta: [
    { name: 'description', content: 'Page description' },
    { property: 'og:title', content: 'Open Graph Title' }
  ],
  link: [
    { rel: 'canonical', href: 'https://example.com/page' }
  ],
  htmlAttrs: { lang: 'en' }
})

useI18n

Internationalization with pluralization support.

import { useI18n } from '@sututu/vue/composables'

const { t, locale, formatDate, loadLocale } = useI18n()

// Simple translation
t('greeting') // "Hello"

// With interpolation
t('welcome', { name: 'John' }) // "Welcome, John!"

// Pluralization
t('items', { count: 1 }) // "1 item"
t('items', { count: 5 }) // "5 items"

// Date formatting
formatDate('2025-12-04T10:30:00Z') // "Dec 4, 2025, 10:30 AM"

useError

Error handling utilities.

import { useError, createError } from '@sututu/vue/composables'

const { error, clearError } = useError()

// Throw a fatal error (will show error page)
throw createError({ statusCode: 404, message: 'Not found' })

Components

SututuError

Built-in error page component.

<template>
  <SututuError />
</template>

<script setup>
import { SututuError } from '@sututu/vue/components'
</script>

SututuOutlet

Outlet component that shows content or error page. Internally renders <router-view /> and handles error display.

<template>
  <SututuOutlet />
</template>

Configuration

In your sututu.config.js:

export default {
  vue: {
    clientDir: 'src/client',
    publicPath: 'dist/client'
  },
  locale: {
    defaultLocale: 'en',
    availableLocales: ['en', 'es', 'fr']
  }
}

Testing

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

Test coverage thresholds:

  • Composables: 90% statements/lines
  • Components: 80% statements/lines
  • Global: 55% statements/lines