-
-
Save navanathjadhav/9675c37b3dfe9458e0b939133db60da3 to your computer and use it in GitHub Desktop.
Code Example for Asynchronous functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { readFile } from 'node:fs'; | |
/* | |
* Read file asynchronously | |
* Non blocking code | |
*/ | |
readFile('/sample.txt', (err, data) => { | |
if (err) throw err; | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment