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

zeno-store

v1.0.0

Published

A package that handles complex state management

Readme

ZenStore NPM Package

This manages complex state management in a web app

ZenStore NPM package is powerful state management solution designed to simplify complex state management in web applications. With a rich set of features, it provides developers with the tools needed to efficiently handle state in a scalable and maintainable way.

Features and usecase for the package .

1 . Middleware Support

const {Zenstore} = require('zen-store')

//Creating an instance
const zenStore = new ZenStore()

//Middleware Support
const middleare = (prevState, nextState) => {
    console.log('Middleware : State updated ', nextState)
}
zenStore.applyMiddleware(middleware)

ZenStore offers middleware support, allowing developers to inject custom logic into the state update process. This is particularly useful for tasks like logging, asynchronous operations, and third-party integrations.

2. Presistence Middleware

const {PresistenceMiddleware} = require('zen-store')

const persistenceMiddleware = new PersistenceMiddleware('zen-store-state.json');
zenStore.applyMiddleware(persistenceMiddleware.persistState);

The package includes a Persistence Middleware, enabling seamless storage and retrieval of application state. This ensures that the state can persist across page reloads, improving the overall user experience.

3. Event Listeners and Custom Event Triggers

// Event Listeners

zenStore.on('userLoggedIn', user => {
  console.log(`Event Listener: User logged in - ${user.username}`);
});

//unsubscribing listeners
const listener = state => {
  console.log('Listener: State Updated', state);
};

const unsubscribe = zenStore.subscribe(listener);
setTimeout(unsubscribe, 5000) // to unsubsribe after some time

// Custom Event Trigger
zenStore.triggerEvent('userLoggedIn', { username: 'JohnDoe' });

Developers can subscribe to state changes using event listeners, facilitating responsive UI updates. Additionally, ZenStore allows the triggering of custom events, enhancing flexibility in handling various application events.

4. Undo/Redo Functionality

zenStore.setState({ count: 44 });
zenStore.undo();

ZenStore introduces undo and redo functionality, enabling users to navigate through previous states. This is particularly beneficial in scenarios where users need to revert to a specific application state.

5. Debounce State Updates and Batch Update Configuration

// Debounce State Updates
zenStore.setDebounceDelay(500);
zenStore.setState({ count: 45 }, true, true);

// Batch Update Config.
zenStore.startBatchUpdate();
zenStore.queueBatchUpdate({ count: 46 });
zenStore.endBatchUpdate();

The package includes features for controlling the frequency of state updates, offering debouncing options and batch update configurations. This ensures that state updates are optimized for performance.

6. Deep State Comparison

zenStore.enableDeepStateComparison();
zenStore.setState({ nested: { prop: 'value' } });
zenStore.setState({ nested: { prop: 'updatedValue' } });

ZenStore supports deep state comparison, providing developers with granular control over state changes. This feature is valuable in scenarios where precise tracking of changes is crucial.

Some Bonus Documentation of the features enhancements

// Persistent State Storage Configuration
zenStore.setLocalStorageKey('custom-key');
zenStore.persistStateToLocalStorage();

// More Optimal Error Handling
zenStore.setErrorHandler(error => {
  console.error('Custom Error Handler:', error);
});

// Versioning
persistenceMiddleware.incrementVersion();

// Additional features from PersistenceMiddleware
persistenceMiddleware.saveState({ additionalData: 'Persisted Data' });
const loadedState = persistenceMiddleware.loadState();
console.log('Loaded State:', loadedState);

const fileInfo = persistenceMiddleware.getFileInfo();
console.log('File Information:', fileInfo);

persistenceMiddleware.renameFile('new-zen-store-state.json');
persistenceMiddleware.deleteFile();

console.log('Package features demonstration completed.');

Upcoming Features

  • Error Handling Enhancements
  • Advanced Persistence Options
  • Integration with Frameworks

Stay tuned for these exciting additions to the ZenStore package, as we continue to evolve and enhance the state management experience for web developers.``