Skip to content

Instantly share code, notes, and snippets.

@navanathjadhav
Created June 14, 2022 15:45
Embed
What would you like to do?
Code Example for Asynchronous functions
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