fs.readdir() method
fs.readdir() method sits in an upload job. Kabir’s job is read a big CSV. Write that first.
Keep fs.readdir() method small. Kabir should finish read a big CSV in a few lines, not a 40-line dump.
Skip fs.readdir() method and loading the whole file into RAM shows up in an upload job.
fs.readdir() method shows up in an upload job. Name read a big CSV, not “a real-world scenario”.
Don’t do this with fs.readdir() method — loading the whole file into RAM. Interviewers spot it in ten seconds.
Place fs.readdir() method next to nearby Node.js work — createReadStream is the link.
Close fs.readdir() method with — “If I skip it, read a big CSV goes wrong like this: loading the whole file into RAM.”
Say fs.readdir() method in one breath, then createReadStream, then loading the whole file into RAM.