@ruslankonev/nuxt-sse
v1.0.2
Published
A Nuxt module to simplify using Server Sent Events
Downloads
6
Readme
NuxtSSE
Nuxt 3 module to simplify using server sent events.
NOTE: I created this for my own personal use, so it may have issues.
Features
- useServerEventsClient() composable to handle connection to the server automatically.
- useServerEvents() composable to send events from any server api.
- Events can be sent to all connected clients, or to an individual client using a custom id
Quick Setup
- Add
@ruslankonev/nuxt-sse
dependency to your project
yarn add @ruslankonev/nuxt-sse
# or
npm install @ruslankonev/nuxt-sse
#or
pnpm add @ruslankonev/nuxt-sse
- Add
@ruslankonev/nuxt-sse
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@ruslankonev/nuxt-sse'
]
})
That's it! You can now use NuxtSSE in your Nuxt app ✨
Development
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release