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-base

v5.43.0

Published

MemberJunction: Record Set Processor Base - interfaces, types, and source adapters for batched, resumable record-set processing. Client-safe.

Readme

@memberjunction/record-set-processor-base

Client-safe foundation for the MemberJunction Record Set Processing substrate: the shared types, the three pluggable seams, and the built-in source adapters. The server engine that drives these lives in @memberjunction/record-set-processor.

What's in here

| Export | Kind | Purpose | |---|---|---| | IRecordSetSource | seam | yields the record set in cursor-paginated batches | | IRecordProcessor | seam | does the work for a single record | | IProcessRunTracker | seam | persists run lifecycle, per-record detail, checkpoints, pause/cancel | | RecordSetProcessOptions | type | the engine's per-run options | | RecordRef, RecordBatch, ProcessCursor, RecordResult, ProcessRunResult, … | types | the data shapes shared across the seams | | ArraySource, ViewSource, ListSource, FilterSource, KeysetSource | sources | the built-in record-set sources |

The three seams

A processing job is a composition of three independent choices:

  • Sourcewhat records to iterate (a User View, a List, an ad-hoc filter, an in-memory array, or a keyset sweep). Sources paginate themselves and hand back an opaque ProcessCursor the engine round-trips for resume.
  • Processorwhat to do with each record (an Action, an Agent, an Infer-&-Write-Back step, or a function), returning a RecordResult (Succeeded / Failed / Skipped).
  • Trackerwhere to persist run + per-record audit. The default writes the generic MJ: Process Runs / MJ: Process Run Details tables; domain consumers can supply their own.

Source adapters

| Source | Pagination | Notes | |---|---|---| | ArraySource | offset (in-memory) | a fixed list of RecordRef; also use for SingleRecord scopes | | ViewSource | offset | resolves a saved User View; views may carry arbitrary order/filter so offset is used | | ListSource | offset | iterates a List's members via MJ: List Details | | FilterSource | keyset → offset | entity + ad-hoc WHERE; keyset when the entity has a single orderable PK | | KeysetSource | keyset (required) | like FilterSource but asserts keyset eligibility — for large background sweeps |

Implementing a source

import { IRecordSetSource, RecordBatch, ProcessCursor, SourceDescriptor } from '@memberjunction/record-set-processor-base';

export class MySource implements IRecordSetSource {
    Describe(): SourceDescriptor { return { SourceType: 'Filter', SourceFilter: '...' }; }
    async NextBatch(cursor: ProcessCursor | undefined, batchSize: number, contextUser, provider): Promise<RecordBatch> {
        // fetch up to `batchSize` records after `cursor`, return them plus the next cursor + exhausted flag
    }
}

This package carries no server-only dependencies and is safe to import on the client.