UNPKG

ffc-pay-etl-framework

Version:

A framework for creating ETL pipelines in node

25 lines (22 loc) 481 B
// @ts-nocheck const { Transform } = require('node:stream') function rowMetaData () { return new Transform({ readableObjectMode: true, writableObjectMode: true, decodeStrings: false, construct (callback) { this.rowId = 0 callback() }, transform (chunk, _, callback) { chunk['_rowId'] = this.rowId chunk['errors'] = [] this.rowId += 1 callback(null, chunk) } }) } module.exports = { RowMetaData: rowMetaData }