K
K
Kirill Semenov2016-02-20 12:18:36
Node.js
Kirill Semenov, 2016-02-20 12:18:36

Are all functions asynchronous in node.js?

I started learning node.js and after PHP my head is a mess. I understand asynchronous programming. Did I understand correctly that in node any function is asynchronous and is executed in parallel with the code from where it was called?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2016-02-20
@esnote

No.
Asynchronous there are only I / O functions (file system, network, etc.) and some using external libraries (zlib). And yet most of the functions have a synchronous version (fs.readFile/fs.readFileSync).
Everything else is normal functions like url.parse, console.log etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question