Closed jpospychala closed 6 years ago
okay rereading this I think it's an unfortunate example in README.md that this function results are passed to console.log which adds it's own newlines.
Hi @jpospychala
console.log which adds it's own newlines
Yeah, that's it. If you concatenate getHeaderString
and stringifyRecords
outputs, you shouldn't see redundant newlines 😉
console.log(csvStringifier.getHeaderString() + csvStringifier.stringifyRecords(records));
Hi there, nice project! I just found it on npm and noticed some unusual behavior I thought worth reporting. In the example you write:
`console.log(csvStringifier.getHeaderString()); // => 'NAME,LANGUAGE\n'
console.log(csvStringifier.stringifyRecords(records)); // => 'Bob,"French, English"\nMary,English\n'`
but the output then is:
` NAME,LANGUAGE
Bob,"French, English" Mary,English
`
Note the empty newlines after header and after output. I'm not quite sure if this really is correct output.