@numaproj/numaflow-js - v0.0.0-alpha.4
    Preparing search index...

    Namespace map

    Map namespace for one-to-many message transformations.

    Map is the most common UDF type, allowing you to transform each input message into zero or more output messages. Use cases include:

    • Data transformation and enrichment
    • Filtering (return empty array to drop)
    • Message splitting (return multiple messages)
    • Format conversion
    import { map } from '@numaproj/numaflow-js';

    const server = new map.AsyncServer(async (datum) => {
    const data = JSON.parse(datum.value.toString());

    // Filter out invalid data
    if (!data.valid) {
    return [map.Message.toDrop()];
    }

    // Transform and return
    return [new map.Message(Buffer.from(JSON.stringify({
    ...data,
    processed: true
    })))];
    });

    server.start();

    Classes

    AsyncServer
    Message

    Interfaces

    Datum
    MessageOptions
    SystemMetadata
    UserMetadata

    Variables

    UserMetadata