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

vuelm

v0.8.3

Published

Vuelm is Vue State Management inspired by Elm

Readme

VuElm

It's a Vue state management inspired by Elm architecture.

Concepts

There are basically four elements on Elm architecture: Model, Actions, Updates and View.

alt text

The image above describes the flow of Elm's architecture. Vuelm tries to bring it to Vue components.

To know more about Elm Architecture, see this link.

Getting Started

Let's to get started with a simple application: the counter.

First lets create our model. The model is composed by 3 parts: state, updates and actions.

import { store, types } from 'vuelm'

const Type = types('INCREMENT', 'DECREMENT')

const state = {
  count: 0
}

const updates = {
  [Type.INCREMENT](state) {
    state.count = state.count + 1
    return state
  },

  [Type.DECREMENT](state) {
    state.count = state.count - 1
    return state
  }
}

const actions = {
  increment() {
    this.update(Type.INCREMENT)
  },

  decrement() {
    this.update(Type.DECREMENT)
  }
}

export default store(state, updates, actions)

The code above is pretty simple and straightforward. Ths state is representated by { count: 0 }.

The updates may be of two types: INCREMENT or DECREMENT. The updates is responsible for change the state and produces a new state after those changes. In this case we're just increment the count plus 1 or decrement minus 1.

The actions just call this.update(type) method passing the type of update that we need to.

To build the model object, we must to join those three elements, passing to store function as arguments.

Now we need to create our Vue component that will render the counter. The code below show the counter component:

<template>
  <div class="container">
    <label>Counter</label>
    <strong>{{count}}</strong>
    <br/>
    <button class="button" @click="increment()">Increment</button>
    <button class="button" @click="decrement()">Decrement</button>
  </div>
</template>

<script>
  import { connect } from 'vuelm'
  import counter from 'stores/counter'

  const Counter = {
    name: 'Counter',
    data() {
      return { count: 0 }
    }
  }

  export default connect(Counter, { counter })
</script>

This component has two buttons which are used to invoke actions from our store. We use connect function to bind the component with store. You can call actions directly from store, as you can see in above example, we associate increment and decrement action into component.

As we can see Vuelm brings the simplicity and powerful design from Elm architecture to our Vue components.

How To Install

To install Vuelm, you can use:

$ yarn add vuelm     // npm install vuelm -S

Or you can use vue-starter template, as shown below:

$ vue init keuller/vue-starter [project-name]

See the examples to learn more about Vuelm.

See Online Demos