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

olallie

v0.0.8

Published

A simple store

Readme

Olallie

GitHub Actions Workflow Status NPM License NPM Downloads NPM Version NPM Unpacked Size

Background

Built to be a lightweight state management tool for framework-less projects.

The name Olallie comes from a lake in Oregon.

Quick links

Installation

  • Install the module

    npm i olallie
  • Import createStore

    import createStore from 'olallie';
    // or
    const createStore = require('olallie');

Example usage

import createStore from 'olallie';
// or
// const createStore = require('olallie');

const store = createStore({
  state: {
    count: 0
  },
  actions: {
    add(value: number) {
      // Actions have access to
      // state, getters, and other actions
      this.count += value;
      return this.count;
    },
  },
  getters: {
    // State is automatically inferred
    doubled: (state) => state.count * 2,
  },
});

// Call options from the store
store.add(1); // 1
const count = store.count; // 1
const doubled = store.doubled; // 2

Documentation

State

State is always required when creating a new store, and should be an object.

const stateStore = createStore({
  state: {
    count: 1,
  },
});

State values can be accessed from the store itself with type-safety.

// (property) count: number
const count = stateStore.count;

You can also apply custom types to your state.

interface State {
  count: number;
}

const stateStore = createStore({
  state: {
    count: 1,
  } as State,
});

Actions

Actions should update, and, or return state values. They have access to state, getters, and other actions through this.

const store = createStore({
  state: {
    count: 0
  },
  actions: {
    add(value: number) {
      this.count += value;
      return this.count;
    },
    double() {
      this.count = this.doubled;
      return this.count;
    },
    addAndDouble(value: number) {
      this.add(value);
      return this.double();
    },
  },
  getters: {
    doubled: (state) => state.count * 2,
  },
});

Store actions can also be async.

const store = createStore({
  state: {
    response: undefined,
  },
  actions: {
    async fetch(userId: string): Promise<boolean> {
      let data;
      await new Promise((resolve) => {
        setTimeout(() => {
          data = {
            id: userId,
            name: 'John Doe'
          };
          resolve(true);
        }, 1);
      });
      this.response = data;
    },
  },
});

await store.fetch('abcd');
const user = store.response;

Getters

Getters should return computed values without manipulating the state itself.

const store = createStore({
  state: {
    firstName: 'John',
    lastName: 'Doe'
  },
  getters: {
    // State is automatically typed
    /*
    (parameter) state: {
      firstName: string;
      lastName: string;
    }
    */
    fullName: (state) => `${state.firstName} ${state.lastName}`;
  }
});

const name = store.fullName; // "John Doe"

Listeners

Listeners provide a helpful bit of reactivity with your store. They use the Event Target API under the hood, and will dispatch a Custom Event when a state value is changed.

The listen() method will provide a list of your stores state keys to choose from, and automatically infer the value for you.

const store = createStore({
  state: {
    count: 0,
  },
});

// (parameter) event: StoreEvent<S, K>
const listener = store.listen('count', ({ detail, timeStamp }) => {
  // Values are type-safe
  /*
  param (detail): {
    value: number;
    oldValue: number;
  }
  */
  console.log('%j', {
    newValue: detail.value,
    oldValue: detail.oldValue,
    timeStamp
  });
}, false);

store.count++;

Listeners can be removed by calling unlisten().

listener.unlisten();

Contributing

Follow the contributor guidelines when opening a PR, or issue.

Project setup

  1. Install the version of node listed in the .nvmrc

  2. Install modules

  3. Run spec to lint & unit test