Node.js

Event

Node.js / Event

Event

Events

When JavaScript is used inside HTML script, it generally handles the user-generated events such as button press or mouse clicks. The core API of Node.js is an asynchronous event-driven architecture. However, unlike the client-side JavaScript, it handles the events on the server, such as File io operations, server's request and responses etc.

The net.Server object emits an event each time a peer connects to it.

The ReadStream referring to a file emits an event when the file is opened and whenever data is available to be read.

Node.js identifies several types of events. Each event can be attached to a callback function. Whenever an event occurs, the callback attached to it is triggered. The Node.js runtime is always listening to events that may occur. When any event that it can identify occurs, its attached callback function is executed.

Technology
Node.js
want to connect with us ?
Contact Us