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

bandi-events

v0.2.0

Published

Create rewards from webmonetization events

Downloads

2

Readme

Overview

This library is part of the Bandi group of projects. These are meant to encourage and incentivize users to enter into the Web Monetization ecosystem. These projects provide a set of tools to help easily bootstrap a rewards framework for a website or application.

Bandi-Events sets up listeners to monitor transaction events. You can set a custom multiplier to reward users with points based on their contributions. Take the following example:

  • User has 0 points
  • Creator has set a multiplier of 100x
  • User streams 0.01 to creator
  • Bandi-Events captures transaction event and uses multiplier to determine points accrued: 0.01 * 100 = 1 point
  • User balance is updated to 1 and the new balance is returned through callback

Bandi will always be unopinionated about how you use & manage points, and will stay decoupled from any specific systems implementation. It's simply a set of tools intended to help creators bootstrap a rewards system for their applications.

Requirements

Check out the official Web Monetization Quick Start Guide to learn how to set up a wallet for receiving payments. This library assumes you have a meta tag to set up monetization with the payment pointer to your wallet. Example:

<meta
  name="monetization"
  content="$wallet.example.com/alice"
>

Installation

npm install bandi-events --save

or

yarn add bandi-events

Example

const events = new BandiEvents();

events.init({
  currentBalance: 0,
  multiplier: 1000,
  onTransaction: (tx) => console.log(tx),
});

Parameters

| Name | Type | Required | Description | | -------------- | -------- | -------- | ---------------------------------------------------------------------------- | | currentBalance | number | yes | The current point balance for a user. | | multiplier | number | yes | A multiplier for adjusting how many points each transaction will convert to. | | onTransaction | function | no | An optional callback function that triggers on each transaction. |

API

| Name | Returns | Description | | ----------------- | ------- | ---------------------------------------------------------------------------- | | init | void | Initialize a new BandiEvents instance. | | getCurrentBalance | number | Returns the user's current point balance. | | startMonetization | void | Starts the monetization event listener (called automatically with init). | | stopMonetization | void | Stops the monetization event listener (called automatically with cleanup). | | isActive | boolean | Returns whether a BandiEvents instance has been initialized. |

Contributing

If you've noticed a bug or have a feature you'd like to suggest, feel free to open a GitHub Issue. If you would like to contribute to the project, feel free to fork this repo, create a new branch & open a pull request.

Licence

MIT © brewsterbhg