Last active
February 13, 2022 20:08
-
-
Save iMichaelOwolabi/c2d217385d1bdcbc6bdc19e512c358d3 to your computer and use it in GitHub Desktop.
Sample event loop blocking code
This file contains hidden or 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
/** | |
* Event loop blocking code sample | |
*/ | |
const fs = require('fs'); | |
const countries = fs.readFileSync('countries.csv'); | |
console.log(countries.toString()); | |
// Other JavaScript code below this line will be blocked until the file reading completes. | |
console.log('Other JAVASCRIPT THAT IS BLOCKED'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment