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

vuex-modern

v2.0.0

Published

Modern Vuex 4 implementation for Vue 3 powered by Composition API. 100% API compatible, lightweight, and full DevTools support.

Readme

Vuex Modern

✨ Features

  • Lightweight: Core rewritten using Vue 3 reactive & computed. No hidden Vue instances.
  • 🔄 100% Compatible: Drop-in replacement for Vuex 4. Keeps your existing code working.
  • 🛠 DevTools Support: Fully integrated with Vue DevTools (Timeline & Inspector).
  • 📦 Built-in Form Mapping: Native support for getField / updateField (like vuex-map-fields).
  • 🛡 TypeScript: Written in TypeScript with strict type definitions.
  • 🧩 Modular: Full support for nested modules, dynamic registration, and namespacing.

📦 Installation

# pnpm
pnpm add vuex-modern

# npm
npm install vuex-modern

# yarn
yarn add vuex-modern

🚀 Usage

1. Basic Setup (Same as Vuex 4)

import { createApp } from 'vue'
import { createStore } from 'vuex-modern'

const store = createStore({
  state() {
    return {
      count: 0
    }
  },
  mutations: {
    increment(state) {
      state.count++
    }
  }
})

const app = createApp(App)
app.use(store)
app.mount('#app')

2. Composition API (useStore)

<script setup>
import { useStore } from 'vuex-modern'

const store = useStore()

function inc() {
  store.commit('increment')
}
</script>

<template>
  <button @click="inc">{{ store.state.count }}</button>
</template>

3. Built-in Two-Way Binding (vuex-map-fields)

No need to install extra libraries. vuex-modern includes getField, updateField, and mapFields out of the box.

Store Setup:

import { createStore, getField, updateField } from 'vuex-modern'

const store = createStore({
  state: {
    user: {
      name: '',
      email: ''
    }
  },
  getters: {
    getField // register built-in getter
  },
  mutations: {
    updateField // register built-in mutation
  }
})

Component Usage:

<script>
import { mapFields } from 'vuex-modern'

export default {
  computed: {
    // Two-way binding helper
    ...mapFields(['user.name', 'user.email'])
  }
}
</script>

<template>
  <input v-model="name">
  <input v-model="email">
</template>

🔍 Migration from Vuex 4

Option 1: Standard Migration

  1. Uninstall vuex.
  2. Install vuex-modern.
  3. Replace imports globally:
    - import { createStore } from 'vuex'
    + import { createStore } from 'vuex-modern'

Option 2: Alias Install (Zero Code Changes)

If you want to keep using import ... from 'vuex' without changing your codebase, you can install vuex-modern as an alias for vuex.

Using pnpm / npm / yarn:

# pnpm
pnpm add vuex@npm:vuex-modern

# npm
npm install vuex@npm:vuex-modern

# yarn
yarn add vuex@npm:vuex-modern

This will update your package.json to look like this:

"dependencies": {
  "vuex": "npm:vuex-modern@^0.1.2"
}

🧪 Testing

We use Vitest for testing. The project passes all core unit tests from the official Vuex 4 repository.

pnpm test

📄 License

MIT