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

hazo_collect

v0.2.5

Published

Collector-manager engine for the Ocdata platform

Readme

hazo_collect

Collector-manager engine for the Ocdata platform. Handles plugin discovery, contract validation, execution orchestration, result persistence, and watermark/health tracking.

Installation

npm install hazo_collect

Peer deps: hazo_core, hazo_connect. Optional: hazo_secure (for secrets injection).

Module formats

hazo_collect ships as ESM, but every subpath (., ./server, ./sdk) is resolvable from a CommonJS host as well — including a Next.js project ("type": "commonjs") whose worker runs under tsx. Both import('hazo_collect/server') and require('hazo_collect/server') resolve, and a plugin that registers via import { defineCollector } from 'hazo_collect/sdk' is discovered by a discover() call made from the CJS worker — the registry is shared process-wide regardless of how each side is loaded.

Quick start

1. Define a collector (SDK)

import { defineCollector } from 'hazo_collect/sdk';
import { parseManifest } from 'hazo_collect';

defineCollector({
  manifest: parseManifest({
    name: 'my_source',
    kind: 'source',
    version: '1.0.0',
    runtime: 'node',
    entry: './my_source.js',
    idempotency_key: ['record_id'],
  }),
  async run(ctx) {
    const rows = [{ record_id: 'r1', data: 'hello' }];
    await ctx.write({ plugin: 'my_source', rows, idempotency_key: ['record_id'] });
    return { records_fetched: rows.length, records_written: rows.length };
  },
});

2. Create a manager and run the collector

import { createManager, nodeRuntime, createInMemoryRegistry } from 'hazo_collect/server';

const manager = createManager({
  getHazoConnect: () => adapter,      // hazo_connect adapter
  getCollector: name => registry.get(name),
  runtime: nodeRuntime,
});

const result = await manager.runNow({ plugin: 'my_source' });
// result.data: RunResult — status, records_fetched, records_written, errors, watermark

API

hazo_collect (client-safe)

| Export | Description | |---|---| | CONTRACT_VERSION | Current contract version string ("1.0.0") | | parseManifest(obj) | Parse + validate a plugin manifest; throws HazoValidationError on invalid input | | parseRunResult(obj) | Parse + validate a RunResult object | | parseRunEnvelope(obj) | Parse + validate a RunEnvelope; applies defaults | | validateInputs(manifest, payload) | Validate run inputs against a manifest's JSON schema |

hazo_collect/server

| Export | Description | |---|---| | createManager(opts) | Main orchestration pipeline — resolve → validate → run → persist | | nodeRuntime | Execution adapter for in-process Node.js collectors | | createInMemoryRegistry() | In-memory registry backed by the SDK Map | | persistRegistry(adapter, manifests) | Upsert manifests into hazo_collect_plugin_registry; quarantines invalid entries | | discover(opts) | Scan directories for manifest.json files and return parsed entries | | createWriteAdapter(adapter, runId) | Create a ctx.write function bound to a specific run |

hazo_collect/sdk

| Export | Description | |---|---| | defineCollector(def) | Register a collector in the process-global registry | | getCollector(name) | Look up a registered collector by name | | listCollectors() | Return all registered collectors | | defineSink(def) | Register a sink (data destination) | | getSink(name) | Look up a registered sink | | resetCollectorRegistry() | Clear all registrations (test hygiene) |

The registry is a process-global singleton keyed on globalThis[Symbol.for('hazo_collect.collectors')]. This guarantees that a collector registered through hazo_collect/sdk is visible to discover() / listCollectors() in hazo_collect/server, even when the two entry points are bundled separately or loaded under different module formats (see Module formats below).

defineCollector / defineSink accept the manifest input shape (ManifestInput): fields with defaults — timezone, timeout_sec, concurrency, retry.* — may be omitted. The registry runs parseManifest to fill defaults before the runtime reads them, so wrapping the literal in parseManifest(...) (as in the quick start above) is optional.

Database tables

Run migrations from hazo_collect/ddl/sqlite.sql (SQLite) or hazo_collect/ddl/postgres.sql (PostgreSQL):

  • hazo_collect_plugin_registry — discovered manifest catalogue with validity + quarantine info
  • hazo_collect_plugin_runs — per-run scorecard (status, records, contract_version, watermark)
  • hazo_collect_plugin_health — rolling health state (consecutive failures, last status)
  • hazo_collect_landing — idempotent landing zone for collector output rows

Tailwind v4 (@source required)

@source "../node_modules/hazo_collect/dist";

License

MIT