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

eazi

v1.0.1

Published

An efficient and lightweight messaging library for your front-end.

Readme

Eazi

An efficient and lightweight messaging library for your front-end.

Introduction

Ever wanted to have a way to keep all your tab's states in sync with minimal effort? (Or) Wanted a lightweight option to communicate between frontend components kept way apart from each other in the application architecture without using a bulky state-management solution?

Well, you can do both so with Eazi.

Some other advantages

  • Lightweight (4 Kb minified)
  • Uses the BroadcastChannel API by default. Falls back to automatically select browser storage events vs BroadcastChannel if not available.
  • Fully Typed and has a clean interface.

Installing

npm i --save eazi

and then:

import { Channel } from "eazi";

or if you're a plain HTML fan:

<script type="text/javascript" id="mediatorLoadingScript" src="https://unpkg.com/eazi"></script>
<script type="text/javascript">
	mediatorLoadingScript.onLoad = () => {
		const Channel = eazi.Channel;
	}
</script>

Usage Example

Let's see how you can simplify something like logging a user out from all tabs when they sign out from one tab.

Simply create channels, each channel requires a name that can be shared across channels in different part of the codebase:

const channelInOneTab = new Channel("auth-state");

const channelInAllOtherTabs = new Channel("auth-state");
channelInAllOtherTabs.addMessageListener((eventData) => {
	if (eventData.action === "logout") logoutUserFromThisTabToo();
});

// Dispatch an event from first tab to all other tabs
channelInOneTab.sendMessage({ action: "logout" });

Note: Messages sent from a channel do not invoke listeners for the instance that sent the message

Storage based events channel

Simple use the second argument of the Channel constructor to pass a strategy option and set it to storage.

Note: Events passed via storage events should be serializable. I.E: Functions and circular references wouldn't work.

const storageBasedEventChannel = new Channel("user-info-updates", {
	strategy: "storage",
});

Simple Channel

Use this for when you don't need cross-tab/cross-window events but rather communication in the same tab.

const noCrossTabCommChannel = new Channel("same-tab-pings", {
	strategy: "simple",
});

Usage with React

If you're using React, you don't have to worry about the lifecycle, we have the useChannel hook for that.

The hook takes care of unmounting message listeners and closing connections to open channels on unmounting.

It supports the same strategy options as its second argument as the regular Channel constructor.

import { useChannel } from 'eazi/react';

const Component = () => {
	const channel = useChannel("app-wide-events");

	useEffect(() => {
		channel.addMessageListener(eventData => {
			...
		})
	}, []);

	...
}