Initial commit

This commit is contained in:
Spencer Pincott
2024-07-15 22:20:13 -04:00
commit 97737ca1ae
16618 changed files with 934131 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
const transform = require('..')
// Generate a dataset of 5 records
const records = 'record\n'.repeat(5).trim().split('\n')
// Initialize the transformation
const transformer = transform(records, (record, callback) => {
setTimeout( () => {
const {running, started, finished} = transformer
callback(null, `${running}_${started}_${finished}\n`)
}, 100)
})
// Get notify when done
transformer.on('end', () => {
process.stdout.write('-------\n')
const {running, started, finished} = transformer
process.stdout.write(`${running}_${started}_${finished}\n`)
})
// Print the transformed records to the standard output
transformer.pipe(process.stdout)