NodeJS is extremely streamable, including HTTP responses. HTTP being a first-class protocol in Node, make HTTP response streamable in very convenient way. HTTP chunked encoding allows a server to keep sending data to the client without ever sending the body size. Unless we specify a “Content-Length” header, Node HTTP server sends the header

to […]

Read More →

Child process is a process created by another process (the parent process). The child inherits most of its parent’s attributes, such as file descriptors. On Node, we can spawn child processes, which can be another Node process or any process we can launch from the command line. For that we will have to provide the […]

Read More →

UDP is a connectionless protocol that does not provide the delivery characteristics that TCP does. When sending UDP packets, there is no guarantee for the order of packets and no guarantee for all packets will arrive. This may lead to conclusion that there is possibility that packets are arrive in random order or packets are […]

Read More →

UNIX socket or Unix domain socket, also known as IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing within the same host operating system. The similar functionality used by named pipes, but Unix domain sockets may be created as connection-mode or as connectionless. Unix domain sockets use the […]

Read More →

TCP or Transmission Control Protocol, is a connection oriented protocol for data communication and data transmission in network. It provides reliability over transmitted data so the packets sent or received is guaranteed to be in correct format and order. Node has a first-class HTTP module implementation, but this descends from the “bare-bones” TCP module. Being […]

Read More →

Stream is an object that represents a generic sequence of bytes. Any type of data can be stored as a sequence of bytes, so the details of writing and reading data can be abstracted. Node has a useful abstraction for stream. More specifically, two very abstractions: Read Streams and Write Streams. They are implemented throughout […]

Read More →

HTTP or Hyper Text Transfer Protocol is an application protocol for distributed, collaborative, hypermedia information systems. It is the protocol which become the foundation of data communication for the World Wide Web. HTTP in most case is using client-server architecture. It means there are one (or more) server which can serve several client. NodeJS has […]

Read More →

A timer is a specialized type of clock for measuring time intervals. It is used for deploying routine action. Node implements the timers API which also found in web browsers. setTimeout setTimeout let us to schedule an arbitrary function to be executed in the future. For example:

The code above will register a function […]

Read More →

Many objects can emit events, in NodeJS of course. For instance a TCP server can emit a ‘connect’ event every time a client connects, or a file stream request can emit a ‘data’ event. Connecting an Event One can listen for events. If you are familiar with other event-driven programming, you will know that there […]

Read More →