Skip to content

Instantly share code, notes, and snippets.

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