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

sui-events-indexer

v1.0.2

Published

A CLI tool that generates a complete event indexing solution for Sui Move packages

Downloads

6

Readme

Sui Events Indexer

A CLI tool that generates a complete event indexing solution for Sui Move packages. It automatically:

  • Creates TypeScript types from Move events
  • Generates a Prisma schema for event persistence
  • Scaffolds an event indexer with handlers for each event type
  • Sets up a REST API to query indexed events

The generated project provides a production-ready setup for indexing and serving Sui events with type safety and database persistence.

Features

  • 🔄 Automatic TypeScript DTO generation from Move events
  • 🗃️ Prisma schema generation
  • 🌐 Support for all Sui networks (mainnet, testnet, devnet)
  • 🔍 Intelligent dependency resolution for event types
  • 📦 Complete project scaffolding with Express API and event indexer
  • 🚀 Automatic database schema application
  • ⚡ Configurable polling intervals
  • 🔄 Event persistence with PostgreSQL

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Docker and Docker Compose (for PostgreSQL)

Installation

npm install -g sui-events-indexer

Options

  • -p, --package <id> (required) - Package ID to index events from
  • --name <name> (required) - Project name
  • -o, --output <dir> - Output directory (default: current directory)
  • -n, --network <network> - Network to use (default: mainnet)
  • -i, --interval <ms> - Polling interval in milliseconds (default: 1000)

Example

sui-events-indexer generate \
-p 0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809 \
--name my-custom-project \
--network mainnet \
-i 1000

Development

To test locally:

npm run dev:generate -- \
-p 0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809 \
--name my-custom-project \
--network mainnet \
-i 1000

Project Structure

The generated project includes:

my-custom-project/
├── prisma/
│   └── schema.prisma     # Generated Prisma schema
├── handlers/             # Event-specific handlers
├── indexer/             # Event indexing logic
├── types/               # Generated TypeScript types
├── config.ts            # Project configuration
├── db.ts                # Database client
├── indexer.ts           # Indexer entry point
├── server.ts            # Express API server
└── docker-compose.yml   # PostgreSQL setup

Running the Project

  1. Start the database:
docker compose up -d
  1. Setup the database schema:
npm run db:setup:dev
  1. Start the indexer:
npm run indexer
  1. Start the API server:
npm run api:dev

API Endpoints

The project automatically generates RESTful endpoints for each event type in your package. Each endpoint follows the pattern /events/{module}/{event-name} where the event name is converted to kebab-case format.

Access your indexed events through these dynamically generated endpoints that match your package's event structure.