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

zerodb-trigger

v1.0.0

Published

Drop-in Trigger.dev replacement backed by ZeroDB event hooks. Define triggered jobs with zero config — auto-provisions on first use.

Downloads

188

Readme

zerodb-trigger

Drop-in Trigger.dev replacement backed by ZeroDB event hooks. Zero config — auto-provisions on first use.

Why?

Trigger.dev is great for background jobs, but you need infrastructure. zerodb-trigger gives you the same defineJob() API backed by ZeroDB's managed event hooks. No server, no config, no signup — just npm install and go.

Install

npm install zerodb-trigger

Quick Start

import { ZeroDBTrigger } from 'zerodb-trigger';

const trigger = new ZeroDBTrigger();

// Define a triggered function
trigger.defineJob({
  id: 'process-upload',
  name: 'Process File Upload',
  trigger: 'zerodb.file.uploaded',
  run: async (event, io) => {
    const file = event.data;
    await io.logger.info('Processing:', file.file_name);
    // ... process file
    return { processed: true };
  }
});

// Emit an event (triggers matching jobs)
await trigger.emit('zerodb.file.uploaded', {
  file_name: 'report.pdf',
  size: 1024,
});

That's it. On first use, a free ZeroDB project is auto-provisioned. You'll see a claim URL in the console to keep it permanently.

Supported Triggers

| Trigger | Fires When | |---------|-----------| | zerodb.vector.stored | A vector embedding is stored | | zerodb.memory.stored | A memory is stored | | zerodb.file.uploaded | A file is uploaded | | zerodb.table.row_inserted | A NoSQL table row is inserted | | zerodb.event.published | Any event is published to the stream | | custom.* | Custom events (any name starting with custom.) |

Trigger.dev Migration Guide

Replace @trigger.dev/sdk with zerodb-trigger:

- import { TriggerClient } from '@trigger.dev/sdk';
+ import { ZeroDBTrigger } from 'zerodb-trigger';

- const client = new TriggerClient({ id: 'my-app' });
+ const trigger = new ZeroDBTrigger();

// defineJob works the same way
trigger.defineJob({
  id: 'sync-data',
  name: 'Sync Data',
- trigger: eventTrigger({ name: 'sync.requested' }),
+ trigger: 'zerodb.event.published',
  run: async (event, io) => {
    await io.logger.info('Syncing...');
    const result = await io.runTask('fetch-data', async () => {
      return fetchData();
    });
    return result;
  },
});

What's different?

| Feature | Trigger.dev | zerodb-trigger | |---------|------------|---------------| | Setup | Self-host or cloud signup | Zero config, auto-provisions | | Triggers | Custom event triggers | 5 built-in + custom.* | | IO helpers | io.runTask, io.wait, io.logger | Same API | | Webhooks | Built-in | registerHook() / handleWebhook() | | Polling | N/A | startPolling() for pull-based | | Dependencies | Many | Zero (native fetch) |

Webhooks

Register a webhook to get notified of events:

// Register webhook
const hook = await trigger.registerHook(
  'zerodb.file.uploaded',
  'https://your-app.com/api/webhook'
);

// In your webhook handler (Express/Fastify/etc)
app.post('/api/webhook', async (req, res) => {
  const results = await trigger.handleWebhook(req.body);
  res.json({ results });
});

// List & remove hooks
const hooks = await trigger.listHooks();
await trigger.removeHook(hook.hookId);

Polling Mode

For serverless or when webhooks aren't practical:

const trigger = new ZeroDBTrigger();

trigger.defineJob({
  id: 'watcher',
  trigger: 'zerodb.memory.stored',
  run: async (event) => console.log('New memory:', event.data),
});

// Poll every 5 seconds
await trigger.startPolling(5000);

// Stop when done
trigger.stopPolling();

Job Management

// List all jobs
const jobs = trigger.getJobs();

// Get specific job
const job = trigger.getJob('process-upload');

// Disable/enable
trigger.disableJob('process-upload');
trigger.enableJob('process-upload');

Configuration

const trigger = new ZeroDBTrigger({
  apiKey: 'your-zerodb-api-key',    // or env ZERODB_API_KEY / TRIGGER_API_KEY
  projectId: 'your-project-id',     // or env ZERODB_PROJECT_ID / TRIGGER_PROJECT_ID
  apiUrl: 'https://api.ainative.studio', // default
  silent: false,                     // suppress console output
});

CommonJS

const { ZeroDBTrigger } = require('zerodb-trigger');
const trigger = new ZeroDBTrigger();

ZeroDB is an AI-native database with vectors, NoSQL, files, events, and Postgres — all auto-provisioned.

Get a free database instantly at zerodb.ai | Docs | npm