How to use read and write streams in node.js for BIG CSV files

  Рет қаралды 38,211

Web Dev Cody

Web Dev Cody

Күн бұрын

Пікірлер: 28
@sameerbharadwaj11
@sameerbharadwaj11 Жыл бұрын
Thank You! This helped a lot with writing 20mil records to solr.
@WebDevCody
@WebDevCody Жыл бұрын
Oh wow this actually helped? I’m glad 😂
@martinmingosuarez8690
@martinmingosuarez8690 2 жыл бұрын
there is a core module called readline that works with streams to read one line at a time, no need to write the logic yourself, otherwise great explanation and video. Cheers
@veremox
@veremox Жыл бұрын
im not an expert but a chunk is not necessarily a line...
@oscarmamani5996
@oscarmamani5996 Жыл бұрын
martinmingosuarez8690 thank you for this comment! it help me
@LegendKopper
@LegendKopper 10 ай бұрын
-----The topic "NodeJS streams----> (your head)
@pranjaldoorwar9743
@pranjaldoorwar9743 2 жыл бұрын
This might be helpful to me i am trying to read csv data and insert it into mongodb first before parsing it
@ViktosB
@ViktosB 6 ай бұрын
Hi, I really enjoy your videos. One of the most productive publisher on KZbin. But in that video the name "overWatermark" is highly misleading. I struggled understand the whole structure only because of that naming. This would be better if you use instead "canWrite". canWrite is true when we can write and false when the buffer is full. Then we stop -> !canWrite. const canWrite = writeStream.write(`${i}, `); if (!canWrite) { await new Promise((resolve) => writeStream.once('drain', resolve)); } } I might be wrong of course. Other than that - great job again. Continue watching you content 🙂
@PhuTran-nb7me
@PhuTran-nb7me 2 жыл бұрын
Hello Sir, I have a question, much appreciated If you can address my doubt. Do chunks come in sequence, in other words, does the read stream wait for the current chunk to finish the operations before it emit the "data" event to process the next chunk? You have a potentially long running iteration there and more importantly, each chunk is interdependent to each other as the last If statement is used to assign the last incomplete row to "unprocessed" variable for the next chunk to use.
@WebDevCody
@WebDevCody 2 жыл бұрын
Yes they should come in order.
@empty8537empty
@empty8537empty 2 жыл бұрын
It should be in order..which is taken care by your transport layer..
@officialabdulrehman
@officialabdulrehman Жыл бұрын
This was very helpful. Thank you
@Tony.Nguyen137
@Tony.Nguyen137 2 ай бұрын
What if I want to read big data of users - User{age:20………height:7“} - and save it into a database, but that chunk of data miss some properties that a user have like age:20“ ? Could this happen if yes how to solve it
@vpetryniak
@vpetryniak Ай бұрын
How to use Web stream API in node js to do the same thing?
@bipinshukla5222
@bipinshukla5222 Жыл бұрын
Awesome explaination
@CarlosHonorioBriones
@CarlosHonorioBriones 2 жыл бұрын
nice! This is good to know. Thanks!
@lucanthony2209
@lucanthony2209 2 жыл бұрын
Hello @vJunkie, Thanks for the great content. CAn you make a video using csv-parser & fs libraries to read & write csv files ?
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Super stuff, thanks. Subbed
@rorycawley
@rorycawley 2 жыл бұрын
Great video, thanks
@ПетърТодоров-о7ф
@ПетърТодоров-о7ф Жыл бұрын
thank u, buddy!
@YOUdudex
@YOUdudex Жыл бұрын
Cool video, thanks subscribed
@mtuchidev
@mtuchidev Жыл бұрын
How do you pass a chunk size ?
@SeibertSwirl
@SeibertSwirl 2 жыл бұрын
Good job babe!!!
@haohong5141
@haohong5141 Жыл бұрын
node version?
@himaliamit8698
@himaliamit8698 2 жыл бұрын
if you show us the format of the csv file it would have made much more sense.
@majidshah48
@majidshah48 2 жыл бұрын
i think opening the file will take time or it might just crash
@boople2snoot
@boople2snoot 2 жыл бұрын
them jump cuts
@boople2snoot
@boople2snoot 2 жыл бұрын
also no sub, your variable is overWatermark, you're waiting for an event emitter if not overWatermark, the function therefore must return true if it is not over the watermark and var should be named underWatermark. Or it would run if not overWatermark, which is under the watermark, which? shit you just ramble, bye.
How to use "Streams" to improve performance in Node.js?
12:22
Software Developer Diaries
Рет қаралды 22 М.
Node.js #6 Буфер и потоки (Buffer & Streams)
7:54
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,5 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 21 МЛН
Deep Dive into Blobs, Files, and ArrayBuffers
17:42
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 36 М.
Hardest Backend Node.js Concept to Master
11:20
Mehul - Codedamn
Рет қаралды 68 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 648 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
This is the coolest side project I've worked on
19:18
Web Dev Cody
Рет қаралды 27 М.
All you need to know about "child_process" in Node.js
12:38
Software Developer Diaries
Рет қаралды 7 М.
Object Oriented Programming is Good | Prime Reacts
31:30
ThePrimeTime
Рет қаралды 309 М.
Node JS Tutorial for Beginners #14 - Readable Streams
8:25
Net Ninja
Рет қаралды 217 М.
You're Probably Using Nuxt Wrong
5:16
LearnVue
Рет қаралды 25 М.