Promise.withResolvers in JavaScript
Let me know if you've heard this one before. You have a function that is reading some sort of file (let's say a csv with a known format and no header line). You want to use streams so you can act on each line but you need to return a promise that resolves once the file has been fully read. Nine times out of ten, you've probably been wrapping the whole function up in a promise definition. I'd suspect something like the below code.
// The data type we want from our csv
type Child = {
name: stri