#07 Reading & Writing files asynchronously | Fundamentals of NODE JS | A Complete NODE JS Course

  Рет қаралды 22,016

procademy

procademy

Күн бұрын

Пікірлер: 27
@malikumairsajjad4673
@malikumairsajjad4673 6 ай бұрын
Best and easiest explanation ever had !
@vamsikrishna1344
@vamsikrishna1344 2 жыл бұрын
please add async await, promises video links in the description.
@adarshkhatri993
@adarshkhatri993 Жыл бұрын
Idk why I come too much late on your channel😢... Your way of explanation and your videos are awesome man❤❤
@osamaxz5720
@osamaxz5720 Ай бұрын
thanks for explaining bro ❤ I'm a frontend developer now learning node js for backend so I'm familiar with pyramid of DOM or callback hell so what I do to solve this problem is promisfing the functions and use async await like to read file async I made this function async function readFileAsync(path, options) { return new Promise((res, rej) => fs.readFile(path, options, (err, data) => { if (err) { rej(err); } else { res(data); } }) ); } now to read specific file async function readTest() { try { const data = await readFileAsync('./test.txt', {encoding: 'utf-8'}) console.log(data) } catch(err) { console.log(err.message) } } and it's easy at is :)
@Miftah-Ul-Uloom
@Miftah-Ul-Uloom Жыл бұрын
Thank you for your great effort. Please add async await, promises video links in the description.
@asiaahmadali
@asiaahmadali Жыл бұрын
Thank you soo much for amazing explanation
@prakashkumarsingh9477
@prakashkumarsingh9477 Жыл бұрын
the course i really like
@spatialnasir
@spatialnasir Жыл бұрын
Great explanation.
@godwin-jnrokoko9524
@godwin-jnrokoko9524 Жыл бұрын
Thank you for this epic course. Please add the link to the course on await and promise video course. Thanks in anticipation
@josyafritudemedia551
@josyafritudemedia551 2 ай бұрын
Bro using Mr jonas course on undemy?
@GhulamMustafa-kj4cv
@GhulamMustafa-kj4cv Ай бұрын
if I want to write the first 5 or last five or I want to search into the file and then I want to write the specific lines of text which can be found anywhere in the file to other file how can i do this and what about buffers
@hassannouri9796
@hassannouri9796 Жыл бұрын
❤❤❤
@vamsikrishna1344
@vamsikrishna1344 2 жыл бұрын
Thank you
@AnilKumar-pb3pc
@AnilKumar-pb3pc 5 ай бұрын
How to avoid Call back hell and where i can get those link pls share me if u had any one??
@mohammedabdulaziz3658
@mohammedabdulaziz3658 2 жыл бұрын
Thanks
@juanvasquezaldana8825
@juanvasquezaldana8825 Ай бұрын
pls, I think you forgot to add the async await and promises video links on the description! thank you
@tharletalkiesofficial
@tharletalkiesofficial Жыл бұрын
couldn't find async await videos
@SpotAbsoluteworldwide
@SpotAbsoluteworldwide Жыл бұрын
kzbin.info/www/bejne/e5DMYaeorpelpas&pp=ygUxYXN5bmMgYXdhaXQgYW5kIHByb21pc2VzIGluIGphdmFzY3JpcHQgIHByb2NhZGVteQ%3D%3D
@SpotAbsoluteworldwide
@SpotAbsoluteworldwide Жыл бұрын
kzbin.info/www/bejne/hXy3iJ16bq9se6s&pp=ygUxYXN5bmMgYXdhaXQgYW5kIHByb21pc2VzIGluIGphdmFzY3JpcHQgIHByb2NhZGVteQ%3D%3D
@p4nd4tz52
@p4nd4tz52 Жыл бұрын
const util = require('util'); const readFileAsync = util.promisify(fs.readFile); // ***** Direct utilizing promises ***** readFileAsync('./inpu.txt', 'utf-8') .then(data => { console.log(data); }).catch(error => { console.log(`${error}`); }) // ***** Using await/async ***** async function readFiles() { try { const data1 = await readFileAsync('./input1.txt', 'utf-8'); const data2 = await readFileAsync('./input2.txt', 'utf-8'); const data3 = await readFileAsync('./input3.txt', 'utf-8'); console.log(data1, data2, data3); } catch (error) { console.error(error); } } readFiles(); Please correct me if i am wrong.
@spatialnasir
@spatialnasir Жыл бұрын
Thanks.
@suyashmehare8034
@suyashmehare8034 9 ай бұрын
Where are the links????
@sujeetsahu755
@sujeetsahu755 Жыл бұрын
sorry for the late come to your channel
@AbhishekMakwana-p1v
@AbhishekMakwana-p1v Жыл бұрын
damn my man helped lot
@Pareshbpatel
@Pareshbpatel Жыл бұрын
{2023-08-24}
@alimahdi5002
@alimahdi5002 2 жыл бұрын
thank you
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Что такое рекурсия. Фундаментальный JavaScript
20:32
Михаил Непомнящий
Рет қаралды 25 М.
Hardest Backend Node.js Concept to Master
11:20
Mehul - Codedamn
Рет қаралды 70 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН