Node.js usually encourages usage of asynchronous API functions and callbacks. Is it accurate to say that if the function name includes the word "Sync", so this function is a synchronous function?
For example, in this link: https://nodejs.org/api/fs.html , you can see both fs.writeFile(file, data[, options], callback) and fs.writeFile Sync (file, data[, options]). The former is a-synchronous and the latter is synchronous.
Yes, in NodeJS' API(s), functions that contain "Sync", are typically synchronous versions of asynchronous functions.
Edit : Please see StackOverflow user jfriend00's answer , as they went into further detail about how to tell if a function is synchronous or asynchronous in NodeJS' API(s).
Is it accurate to say that if the function name includes the word "Sync", so this function is a synchronous function?
Yes, that is accurate.
Here's how you tell if something is synchronous or asynchronous in the node.js API:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.