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

@memberjunction/record-set-processor

v5.47.0

Published

MemberJunction: Record Set Processor - server engine that batches, rate-limits, resumes, and audits processing of a record set through a pluggable source/processor/tracker pipeline.

Readme

@memberjunction/record-set-processor

The server-side Record Set Processor engine — the single substrate every set-iterating job in MemberJunction routes through. It owns the hardened iteration lifecycle so each consumer doesn't reinvent it, while delegating what to iterate, what to do, and where to persist to the pluggable seams defined in @memberjunction/record-set-processor-base.

What the engine owns

  • Batching with a configurable batch size
  • Bounded concurrency within a batch (maxConcurrency)
  • Rate limiting (optional, token-bucket with a sliding window)
  • Error-rate circuit breaker — auto-fails a run when the error rate exceeds a threshold
  • Budget gate — an onAfterBatch hook to pause when a cost/item budget is exhausted
  • Progress events after each batch
  • Pause / cancel handshake — the tracker re-checks its row's cancellation flag at each checkpoint
  • Resume from a checkpoint — offset or keyset cursor, round-tripped through the tracker
  • Per-record error isolation — one bad record never aborts its batch

Usage

import { RecordSetProcessor, FunctionRecordProcessor } from '@memberjunction/record-set-processor';
import { ViewSource } from '@memberjunction/record-set-processor-base';

const result = await RecordSetProcessor.Instance.Process({
    source: new ViewSource(activeCustomersViewID),
    processor: new FunctionRecordProcessor(async (record, ctx) => {
        // ...do the work for `record` using ctx.provider / ctx.contextUser...
        return { Status: 'Succeeded', ResultPayload: { summarized: true } };
    }),
    contextUser,
    batchSize: 100,
    maxConcurrency: 4,
    recordProcessID,          // optional facade linkage
    triggeredBy: 'Schedule',
});

console.log(`${result.Status}: ${result.Success}/${result.Processed} ok, run ${result.ProcessRunID}`);

By default the engine persists to MJ: Process Runs / MJ: Process Run Details via GenericProcessRunTracker. Pass tracker: new NoOpTracker() for fire-and-forget single-record work, or your own IProcessRunTracker to persist into domain-specific tables.

Exports

| Export | Purpose | |---|---| | RecordSetProcessor | the engine singleton — RecordSetProcessor.Instance.Process(options) | | GenericProcessRunTracker | default tracker writing the generic Process Run tables | | NoOpTracker | a tracker that persists nothing | | FunctionRecordProcessor | a processor backed by a function | | RateLimiter | the token-bucket limiter used when rateLimit is configured |

Source adapters, the seam interfaces, and all shared types are re-exported from @memberjunction/record-set-processor-base.

Server-only. This package executes work and persists runs; use it on the server. The base package (types + seams + sources) is client-safe.