Skip to content

Instantly share code, notes, and snippets.

@korzio
Created May 16, 2020 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korzio/ccee535a8c8261fddac754dd5f75b3ea to your computer and use it in GitHub Desktop.
Save korzio/ccee535a8c8261fddac754dd5f75b3ea to your computer and use it in GitHub Desktop.
const fs = require('fs')
setTimeout(() => console.log('timeout out'))
setImmediate(() => console.log('immediate out'))
fs.readFile('./events.js', () => {
console.log('fs')
process.nextTick(() => console.log('next in'))
setTimeout(() => console.log('timeout in'))
setImmediate(() => console.log('immediate in'))
})
const next = () => {
console.log('next')
process.nextTick(next)
}
process.nextTick(next)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment