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

@veams/vent

v2.1.0

Published

Vent is a simple publish and subscribe system you can use to communicate between modules independently

Downloads

683

Readme

@veams/vent

Vent is a small publish/subscribe utility for loosely coupled modules.

For a file-by-file implementation walkthrough, see LINE_BY_LINE.md.

Install

npm install @veams/vent

Package Exports

Root exports:

  • createEventHandling as the default export
  • EventHandler
  • EventCallback

Subpath exports:

  • @veams/vent/react
  • @veams/vent/plugin
  • @veams/vent/plugin/vent

Quickstart

import createVent from '@veams/vent';

type Events = 'scroll' | 'custom:event';

const vent = createVent<Events>();

const handleCustomEvent = (payload: { testData: string }) => {
  console.log(payload.testData);
};

vent.subscribe('custom:event', handleCustomEvent);
vent.subscribe('scroll', () => {
  vent.publish('custom:event', { testData: 'Hello from Vent' });
  vent.unsubscribe('custom:event', handleCustomEvent);
});

You can subscribe to multiple topics at once by passing a space-separated string:

vent.subscribe('scroll custom:event', (payload) => {
  console.log(payload);
});

Veams Plugin

The plugin attaches a shared event handler to Veams.Vent and merges additional event names into Veams.EVENTS.

import Veams from '@veams/core';
import VentPlugin from '@veams/vent/plugin';
import EVENTS from './custom-events';

Veams.onInitialize(() => {
  Veams.use(VentPlugin, {
    furtherEvents: EVENTS,
  });
});

React

The React entry stays intentionally small and only covers provider-based wiring.

import createVent from '@veams/vent';
import { VentProvider, useVentSubscribe } from '@veams/vent/react';

const vent = createVent<'toast'>(); 

function ToastListener() {
  useVentSubscribe('toast', (message) => {
    console.log(message);
  });

  return null;
}

function App() {
  return (
    <VentProvider instance={vent}>
      <ToastListener />
    </VentProvider>
  );
}

API

vent.subscribe(topic, callback)

Registers a callback for a topic. Alias: vent.on(...).

vent.unsubscribe(topic, callback, completely?)

Removes a previously registered callback. Alias: vent.off(...).

If completely is true, the topic entry is removed after matching callbacks are detached.

vent.publish(topic, data?, scope?)

Notifies subscribers of a topic. Alias: vent.trigger(...).

If scope is omitted, the vent instance is used as the callback context.