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

msgee

v3.0.1

Published

An extended events here

Readme

msgee

An extended events manager. Provides messaging between app components and between browser tabs.

Installation - NPM

npm i msgee

Installation - Browser

<script src="https://unpkg.com/[email protected]/dist/bundle.browser.iife.js"></script>

Usage


Imports - msgee instance:

import msgee from 'msgee';

browser version:

window.msgee;

Imports - constructor:

import { Msgee } from 'msgee';

Actual usage:

import msgee from 'msgee';

const listener = message => { /* listener code */ };
const channelName = 'hey-hey';
const message = 'huh';

// subscribe to a message channel:
msgee.subscribe(channelName, listener);

// send message to a channel:
msgee.push(channelName, message);

// Send a message across browser tabs:
msgee.push(channelName, message, { isMultiTab: true });

// Post message with async listener execution:
msgee.push(channelName, message, { isAsync: true });

In-depth usage:

If for some reason you need a few Msgee instances: You can create one using a constructor with a storage key as a first argument. It is important for multi-tab communication, is optional and defaults to msgee-storage. You need to pass a storage name for it to properly function.

import { Msgee } from 'msgee';

const withDefaultName = new Msgee();
//or:
const withCustomName = new Msgee('storage-key-name');

If for some reason you're unhappy with a default storage key name: You can change it without a need to create a new instance with the constructor, just call the method:

import msgee from 'msgee';

msgee.setStorageKey('storage-key-name');

If you want to create a channel data array manually use msgee.setChannelData:

import msgee from 'msgee';

const channelName = 'some-channel';
const serializableValues = [
  1,
  '1',
  true,
  [ 2 ],
  { qq: true }
]

// Without base data, is an empty array:
const someEmptyChannelData = msgee.setChannelData(channelName);

// With base data, which should be an array of serializable elements:
const someChannelWithData = msgee.setChannelData(channelName, serializableValues)

If you want to get accumulated channel messages use msgee.getChannelData:

const channelName = 'hey-hey';
const channelData = msgee.getChannelData(channelName);

If you want to delete a channel data, use msgee.deleteChannelData:

import msgee from 'msgee';

const channelName = 'hey-hey';

msgee.deleteChannelData(channelName);

// Logs undefined
console.log(msgee.getChannelData(channelName));

If you subscribe to a channel, but msgee has no instance of such channel data, it creates one. If there is no subscriptions to a channel then messages will be accumulated, otherwise not. If you want messages to be accumulated with active subscriptions, use the { shouldSave: true } option.

import msgee from 'msgee';

const channelName = 'hey-hey';

msgee.push(channelName, 'huh');

const channelData = msgee.getChannelData(channelName);

// There is no subscriptions to this channel, logs ['huh']
console.log(channelData);

// Save a message using an option.
msgee.push(channelName, 'hey', { shouldSave: true });

// Logs ['huh', 'hey']
console.log(channelData);