Reference

Configuration

Key options for constructor and stream methods (summary).

new ConvertBuddy({ inputFormat: 'auto', outputFormat: 'json', csvConfig: {}, xmlConfig: {}, debug: false })

Stream options

  • recordBatchSize - records per onRecords callback
  • onRecords - (controller, records, stats, total) => void (preferred; use for stats/total)
  • onData - raw output chunks
  • onProgress - periodic byte-level stats updates (use sparingly)

Transform

Transform configuration: field mapping, coercion, computed fields, error handling.

const transform = { fields: [{ targetFieldName: 'id', coerce: { type: 'i64' } }], onCoerceError: 'null' };

Stats objects

Stats include: bytesIn, bytesOut, recordCount, durationMs, throughputMbPerSec.

Error handling

Prefer streaming handlers: use onError and await controller.done for fatal errors.

const controller = new ConvertBuddy().stream(data, { onError: (err) => console.error(err) });
await controller.done;

See also