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

aniezlouie-js

v1.2.1

Published

a miniature state management library written in javascript

Readme

louie-js

A miniature state management library written in javascript

How to use

1st step

create your states, mutations and actions wherever you want.

states should be an object that contains a collection of properties that you can use to store data

mutations should be an object that contains a collection of pure functions, each functions will take 2 arguments, an object and the payload as an object, the object param contains 1 key to be specific, keyname is state, state is the collection of states you've created as an object, you can access a state and pass the payload to it in this mutation function (Note: NEVER mutate the state to avoid memory leak)

actions should be an object that contains a collection of functions, each function will take 2 arguments, an object that contains a commit key, and the payload in a form of an object, commit key is a function that will take 2 arguments when called, first arg is the mutation function name as a string, second arg is the payload.

stateListener should be a function, this will trigger everytime a state is updated

you can check the examples below.

Example

const states = {
  cart: [],
  orderCount: 0
}

const mutations = {
  addItem({ state }, payload) {
    const currentCart = [...state.cart]
    currentCart.push(payload)
    
    state.cart = currentCart
    state.orderCount = state.orderCount+1
  }
}

const actions = {
  addToCart({ commit }, payload) {
    /** You can add additional logic here before updating the state */
    commit("addItem", payload)
  }
}

const stateListener = (target, property) {
  /** Your logic here */
  const updateView = target[property]
}

2nd step

Create a LouieJS instance globally, passing the states, mutations and actions

Example

const louiejs = new LouieJS(states, mutations, actions, stateListener)

Last step

Dispatch actions from your view controller to update a state (Note: dispatch function can only call the functions defined in your actions object), dispatch method takes 2 argument, action function name as string, and the payload as an object

Example

interface CartItem {
  itemName: string,
  quantity: number
}

function addItemToCart(item: CartItem) {
  louiejs.dispatch("addToCart", item) /** Dispatch will take care of the rest */
}

you can watch for state update by adding logic inside your stateListener function

Example

const stateListener = (target, property) {
  /** Re-initialize variables by the new value of the state */
  const toUpdateView = target[property]
}

you can get the latest value of your state by accessing the getState method, that takes 1 argument, the statename as string

Example

const cart: Array<CartItem> = louiejs.getState("cart")

Visit Github page