How to use the @fast-csv/format.writeToStream function in @fast-csv/format

To help you get started, we’ve selected a few @fast-csv/format examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github C2FO / fast-csv / examples / formatting-js / examples / write_to_stream.example.js View on Github external
const csv = require('@fast-csv/format');

const rows = [
    ['a', 'b'],
    ['a1', 'b1'],
    ['a2', 'b2'],
];
csv.writeToStream(process.stdout, rows);

// Output:
// a,b
// a1,b1
// a2,b2
github C2FO / fast-csv / examples / formatting-ts / examples / append.example.ts View on Github external
return new Promise((res, rej) => {
            writeToStream(stream, rows, options)
                .on('error', (err: Error) => rej(err))
                .on('finish', () => res());
        });
    }
github C2FO / fast-csv / examples / formatting-js / examples / append.example.js View on Github external
return new Promise((res, rej) => {
            csv.writeToStream(filestream, rows, options)
                .on('error', err => rej(err))
                .on('finish', () => res());
        });
    }