Book ValueIn finance, assets are considered at their historical cost rather than present value. Therefore, the price gets depreciated over the years. Sometimes, book value represents net cost minus the amortized value. The book value of debt is represented at its outstanding amount.The difference between book values of assets and liabilities is always equal to net worth or shareholders' funds. Net worth divided by the number of shares gives the value of book value per share. The book value considers cost rather than value. By value, it means the worth of an asset today in terms of its potential advantages ... Read More
Data chunks in Node.js or any other language can be defined as a fragment of data that is sent to all the servers by the client. The servers make a stream of these chunks and form a buffer stream. This buffer stream is then converted into meaningful data.Syntaxrequest.on('eventName', [callback] )ParametersThe parameters are described below −eventName − It is the name of the event that will be fired.callback − Callback function to handle any error if it occurs.ExampleCreate a file with the name "index.js" and copy the following code snippet. After creating the file, use the command "node index.js" to run ... Read More
Node.js is an event-driven JavaScript runtime platform that is built using the Chrome’s V8 JavaScript engine. Node is mainly used for building large-scale applications. In this article, we will see how to run a Java code in Node.js.StepsCheck if Node.js is already installed on your system using the following command −npm initInstall Java on your local system as npm packagenpm install java Ensure that Java is already installed on your system. If not, you need to install Java on your system before running the following code.Example 1Create a file with the name "runJava.js" and copy the following code snippet. After ... Read More
The main aim of a Node.js application is to work as a backend technology and serve requests and return response. But we can also pass inputs directly to a Node.js application.We can use readline-sync, a third-party module to accept user inputs in a synchronous manner.Syntaxnpm install readline-syncThis will install the readline-sync module dependency in your local npm project.Example 1Create a file with the name "input.js" and copy the following code snippet. After creating the file, use the command "node input.js" to run this code.//Giving Input to a Node.js application Demo Example // Importing the realine-sync module const readline = ... Read More
The util.debuglog() method creates a function that can be used to write the desired error/debug messages to stderr. These error messages are written only upon the existence of the NODE_DEBUG environment variable.Syntaxutil.debuglog(section, [callback])ParametersThe parameters are described below −section − This parameter takes the portion of the application for which the debug log is being created.callback − This is the callback function which will receive the pointer if any error occurs during the execution of method.Example 1Create a file with the name "debuglog.js" and copy the following code snippet - Live Demo// util.debuglog() demo example // Importing the util module const ... Read More
The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.update() method updates the hash content with the data passed, and the encoding that is passed along with the parameters. If the encoding is not passed and the data is a string, ‘utf8’ encoding is used.Syntaxhash.update(data, [inputEncoding])ParametersThe parameters are described below −data − This input parameter takes input for the data that will update the hash content.InputEncoding − Encoding to encode the input data or the data stringExample 1Create a file with the name "hashUpdate.js" and copy the following ... Read More
The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.digest() method calculates all the data that needs to be hashed passed inside the hash function and returns them. If an encoding is defined, a string will be returned, else a buffer is returned.Syntaxhash.digest([encoding])ParametersIt takes a single parameter −encoding − This input parameter takes input for the encoding to be applied while calculating the hash.Example 1Create a file with the name "hashDigest.js" and copy the following code snippet. After creating the file, use the command "node hashDigest.js" to run ... Read More
The v8.getHeapStatistics() method returns the statistics about a heap. The getHeapStatistics() method is a part of the v8 module that returns the details about the heap and size of the v8. The getHeapSpaceStatistics() gives stats based upon the spaces in a system, whereas the getHeapStatistics() method gives stats about the whole system.Syntaxv8.getHeapStatistics()ParametersSince it returns the space details/statistics about V8, it does not require any special input parameters. However, the value returned contains the following properties −total_heap_size − This field will return the total heap space size.total_heap_size_executable − This field will return the total heap size that is available for execution.total_physical_size ... Read More
You can use the chalk module to customize the statements printed on the console.By using it, one can change the text font-color to any color. One can also change the font-style to Bold, Italic or Underlined. Also, you can highlight the printed text.Syntaxnpm install chalkExample 1Create a file "color.js" and copy the following code snippet. After creating the file, use the command "node color.js" to run this code.// Giving color to console statments // Importing the chalk module const chalk = require('chalk'); // Printing the text in blue color console.log(chalk.blue('Welcome to Tutorials Point !')); // Printing the ... Read More
Node.js is a completely open source technology that runs on JavaScript runtime environment. When the users want to access a website or link, they connect with the link using their system IP. We can use the dns.lookup() method in Node to find the IP address of the current user.Syntaxdns.lookup(hostname, [options], callback)ParametersThe parameters are described below −hostname − This input parameter consists of the web link which is valid or active.options − Default is 0. It takes input for the IP type, i.e., 4 for Ipv4 and 6 for Ipv6.callback − Handles any error if it occursExample 1Create a file with ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP