How to treat callback function correctly?

  node.js, question

Lz has recently begun to learn nodejs and has seen many new features of ES6, as well as libraries such as CO. If you want to use co, you don’t need to write callback. But I really can’t write when I really want to write by myself. I don’t know when to use callback.

Does callback generally depend on the usage of nodejs API? No callback is required at other times.

Thank you for your advice!

Js is Node.js
Generator Function isGenerator Function
Can’t generalize ~
Just because you KOA doesn’t mean you don’t thank the callback function
The way co is used is just to make the code concise and readable.
The nodejs API you found is ES5′ s.
After all, ES6 is not yet fully popular, and many feature-tested browsers do not support it.
Learn more about KOA and you’ll gradually understand