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

@tashiscool/vue

v0.1.0

Published

Vue 3 composables for LLM streaming

Readme

@llm-utils/vue

Vue 3 composables for LLM streaming. Reactive state management for chat interfaces.

Installation

pnpm add @llm-utils/vue
# or
npm install @llm-utils/vue

Features

  • useStreaming - Full streaming state management
  • useChunkBuffer - Aggregate streaming chunks
  • useTypingIndicator - Typing indicator state
  • useMessageHistory - Persistent message history
  • SSE Support - Parse Server-Sent Events
  • TypeScript - Full type safety

Usage

Basic Streaming

<script setup lang="ts">
import { useStreaming } from '@llm-utils/vue';

const { messages, status, send, isStreaming, abort } = useStreaming({
  endpoint: '/api/chat',
  onChunk: (chunk) => console.log('Received:', chunk),
});

async function handleSend(input: string) {
  await send(input);
}
</script>

<template>
  <div>
    <div v-for="msg in messages" :key="msg.id">
      <strong>{{ msg.role }}:</strong>
      <span>{{ msg.content }}</span>
      <span v-if="msg.isStreaming">▌</span>
    </div>

    <div v-if="status === 'connecting'">Connecting...</div>

    <button @click="abort" v-if="isStreaming">Stop</button>
  </div>
</template>

Stream from URL

const { streamFrom, messages } = useStreaming();

// Stream from any URL
await streamFrom('/api/stream', {
  method: 'POST',
  body: JSON.stringify({ prompt: 'Hello' }),
});

Chunk Buffer

import { useChunkBuffer } from '@llm-utils/vue';

const { content, append, flush } = useChunkBuffer();

// Append chunks
append('Hello ');
append('World');

console.log(content.value); // 'Hello World'
console.log(flush()); // 'Hello World' (also clears)

Typing Indicator

import { useTypingIndicator } from '@llm-utils/vue';

const { isTyping, start, stop, startWithTimeout } = useTypingIndicator();

// Manual control
start();
// ... do work
stop();

// Auto-stop after 3 seconds
startWithTimeout(3000);

Message History with Persistence

import { useMessageHistory } from '@llm-utils/vue';

const { messages, add, remove, clear } = useMessageHistory({
  storageKey: 'my-chat-history',
  maxMessages: 50,
});

// Add message
add({
  role: 'user',
  content: 'Hello!',
  isStreaming: false,
});

// Messages persist across page reloads

API Reference

useStreaming

interface UseStreamingReturn {
  // State
  status: Ref<StreamingStatus>;
  messages: Ref<StreamingMessage[]>;
  currentMessage: ComputedRef<StreamingMessage | null>;
  isStreaming: ComputedRef<boolean>;
  error: Ref<Error | null>;

  // Actions
  send: (content: string, options?) => Promise<void>;
  streamFrom: (url: string, options?) => Promise<void>;
  abort: () => void;
  clear: () => void;
  addMessage: (message) => void;
}

StreamingMessage

interface StreamingMessage {
  id: string;
  role: 'user' | 'assistant' | 'system';
  content: string;
  isStreaming: boolean;
  error?: string;
  startedAt: Date;
  completedAt?: Date;
}

StreamingOptions

interface StreamingOptions {
  endpoint?: string;
  headers?: Record<string, string>;
  transformChunk?: (chunk: string) => string;
  onStart?: (message: StreamingMessage) => void;
  onChunk?: (chunk: string, message: StreamingMessage) => void;
  onComplete?: (message: StreamingMessage) => void;
  onError?: (error: Error) => void;
}

License

MIT