Tag: NodeJS
-
Javascript frameworks 2020
Java script is one of the most essential object orient programming language designed to make web development. It makes things easier, more engaging, responsive, interactive, which helps in enhancing user experience. With the advancement of technology, a various JavaScript framework has also emerged in the market. It is a tool that makes working with Java […]
-
How to use npm Chalk package to style terminal string?
Chalk is a public npm package which can be used to style terminal string.
-
How to include local modules in Node.js application?
We can export the modules that we create locally in other files and folders. This can be done by using module.exports . We have to import the specific file in which the local module is located by using require keyword.
-
How to include core modules in you Node.js application ?
Node.js core modules such as fs(file system) , http, url etc… has to be imported into the program file using the require key word.
-
SetInterval ref and unref in NodeJS
A NodeJS process is alive as along as it has some events and callbacks that are to be processed. So if we have a simple setInterval function in a file, it means the node processor has always some events to be processed periodically. Simply adding this line will make the node run this script file […]
-
Difference between process.nextTick and setImmediate in NodeJS
In a funny deviation from what the name suggests, setImmediate is a callback that will be made after the nextTick() calls! The setImmediate by definition happens after current execution and after timer & I/O events, while the process.nextTick calls will be called after current script execution and before other timer & I/O Events! So an […]
-
What is process.nextTick in NodeJS?
The process.nextTick serves for the design logic where for one, events that are generated by while initialising or creating an object is not generated before the caller has registered listeners for those. Now considering the above case, there is a possible that the disk reader is just for a specific case reading from cache and […]
-
Handling POSIX SIGNALS in NodeJS (Javascript!)
NodeJS, built over the v8 Engine, which is essentially C/C++ application, exposes much if not all of the POSIX signals to the Javascript layer. Hence we can have multiple options coming out of design of architecture using these SIGNALing and SIGNAL Handling possibilities. A few noteworthy things that we can think of from the top […]
-
Difference between console.log and process.stdout.write in NodeJS
NodeJS can print a string to terminal using two ways. The well known console.log as in chrome and the lesser-known process.stdout.write way. Both have the same usage params. While you find console.log ends the line thats printed, the other does not. So which is good to use? The console.log is implemented in the NodeJS Core […]