@brycesteve/nuxt-sse
v1.0.1
Published
A Nuxt module to simplify using Server Sent Events
Downloads
12
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
@brycesteve/nuxt-sse
dependency to your project
yarn add @brycesteve/nuxt-sse
# or
npm install @brycesteve/nuxt-sse
#or
pnpm add @brycesteve/nuxt-sse
- Add
@brycesteve/nuxt-sse
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@brycesteve/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