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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-livestore

v0.2.3

Published

Vue LiveStore is in beta with intention to mature alongside [LiveStore](https://livestore.dev/). Happy to accept suggestions for improvement and contributions. See list of todos below for pending areas.

Downloads

1,265

Readme

Vue bindings for LiveStore

Vue LiveStore is in beta with intention to mature alongside LiveStore. Happy to accept suggestions for improvement and contributions. See list of todos below for pending areas.

Installation

It's strongly recommended to use bun or pnpm for the simplest and most reliable dependency setup (see note on package management for more details).

Install LiveStore

pnpm install @livestore/livestore @livestore/[email protected] @livestore/adapter-web @livestore/utils @livestore/peer-deps @livestore/devtools-vite

Install vue-livestore

pnpm install vue-livestore

Key components:

LiveStoreProvider: Creates the store and provides it to the rest of the wrapped app.

useStore(): Composables to load (inject) the store

useQuery(): Composable to create reactive read-only live queries

useClientDocument(): Composable to get reactive writable client state variables

Usage

For full working example see code in playground.

Follow the Vue LiveStore example for an existing project to:

  1. Adjust Vite config
  2. Create livestore/livestore.worker.ts
  3. Create livestore/schema.ts

Wrap your app in a LiveStoreProvider

<template>
  <LiveStoreProvider :options="{ schema, adapter, storeId }">
    <Todos />
  </LiveStoreProvider>
</template>

useStore and useQuery composables

import { queryDb } from '@livestore/livestore'
import { events, tables } from '../livestore/schema'
import { useStore, useQuery } from 'vue-livestore'

const { store } = useStore()

const visibleTodos$ = queryDb(
  () => tables.todos.where({ deletedAt: null, })
  { label: 'visibleTodos' },
)
const todosQuery = useQuery(visibleTodos$)

store.commit(events.todoCreated({ id: crypto.randomUUID(), text: "Write documentation" }))

useClientDocument

🚨 useClientDocument interface is experimental and might change

Serializes the client document variables into writable computed refs directly from the composable which allows us to write code like this:

<script setup lang="ts">
import { tables } from '../livestore/schema'

const { newTodoText, filters } = useClientDocument(tables.uiState)
</script>

<template>
<input type="text" v-model="newTodoText">

<select v-model="filters">
  <option value="all">All</option>
  ...
<select>
</template>

TODO

  • [ ] Multiple stores support
  • [x] useClientDocument composable
  • [ ] Nuxt integration (might be separate repo or just example implementation)

Comments

Why not a Vue plugin instead of provider pattern? A Vue plugin would probably be more idiomatic to the Vue ecosystem but a provider has the benefit of easily designating a loading slot. It also matches better to the React implementation for LiveStore which makes generalising examples easier. It's possible as this package matures we might switch to a plugin structure if it makes sense. We would also see what the best option would be when integrating into Nuxt.