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

vue-mini-state

v1.0.1

Published

State Management for Vuejs

Downloads

12

Readme

vue-mini-state 🔮

vue-mini-state is a simple state management lib for Vuejs. It uses the Observable object. It's intended to be very simplistic and easy to use. What's the best of it ? It's centralized! Thus, you can use it at different components without worrying about drilling down any prop.

vue-mini-state uses object manipulations in order to merge multiple paths inside the state.

Motivation

State Management is something that always lead you to use a complex third-party library or is either something complex to build from scratch. vue-mini-state is intended to be used still as a third party library but it is extremely small and it uses Vue js native Observable, which in my opinion is very good and should be used more broadly.

I needed to find a way to create a state management that could be used easily inside the directive v-for and inside the HTML templates. As a result, I created this lightweight lib that might be useful for you as it's being useful for me in my Vue projects.

API

  • getState() Returns the entire state.

  • getState(path) Returns the value of the path inside the state.

  • setState(data) Makes the data object to be the entire state. It will be set at the root.

  • setState(data, path) Updates the state at the specified path.

  • resetState() Resets the entire state to its initial value.

Getting Started

$ npm install vue-mini-state

How does it work

vue-mini-state relies on strings that represent the paths that will be used inside the state. For example: The path customer.street.number represents the path to an object that looks like this:

const state = {
  "customer": {
    "street": {
      "number": 5 // any value here
    }
  }
}

You can either select if you want to save the change to the root or if you want to nest it under a specific property

import { getState, setState } from 'vue-mini-state';

setState(16, 'customer.street.number');
setState({ name: 'Juan' }, 'customer');
getState('customer.street.number') // This will return 16;

/**
 * This will return
 *
 * {
 *   customer: {
 *     name: 'Juan',
 *     street: {
 *       number: 16
 *     }
 *   }
 * }
 */
getState();

IMPORTANT

As you can see, vue-mini-state works very well for scenarios in which you are going to populate multiple attributes of an object from different events/places. Moreover, it works assuming that you need the objects to be merged, not replaced.

Get Rid of the v-model

This sound a bit scary at the beggining, but the truth is that you can get rid of the v-model in your top level components and create easily a new Form with only path declarations. I will create a guide that explains to you how to use the vue-mini-state with a Web Components' library and allow you to create forms in a very fast way. Wait for it! :)

Contribute

See the contribution guide