It leverages the stream transform API but input doesn't have to be an readable stream and output doesn't have to be a writable stream. Input may be a string passed as first argument. Output may be obtained in the callback passed as last argument.
Uses it for convenience in case you are already interacting with a readable stream or a writable stream. It is not scalable because it implies that you either have all your records in memory and wish to pipe the generated CSV into a stream writer or that you have a stream reader generated records and wish to obtain a string representing the full CSV text.
The signature of the output stream example is
const stream = stringify(input, [options]). It takes an input string and an options object as arguments and return a readable stream.
Inversely, the signature of the input stream example is
const stream = stringify([options], callback). It takes an options object and a callback function as arguments and return a writable stream.