Dealing with Asynchronously Initialized Components
Learn how to initialize asynchronous components in JavaScript applications.
We'll cover the following...
One of the reasons for the existence of synchronous APIs in the Node.js core modules and many npm packages is that they’re handy to use for implementing initialization tasks. For simple programs, using synchronous APIs at initialization time can streamline things a lot, and the drawbacks associated with their use remain contained because they’re used only once, which is when the program or a particular component is initialized.
Unfortunately, this isn’t always possible. A synchronous API might not always be available, especially for components using the network during their ...