Open In App

Node.js console.dirxml() Method

Last Updated : 10 May, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

The console.dirxml() method calls console.log() method by passing the received argument, this element does not produce any XML formatting.

Syntax:

console.dirxml(object_or_element)

Parameters: This function accepts the following parameter:

  • object: This method take a JavaScript object or element.

Return Value: This method returns the object or element passed.

Below examples illustrate the use of process.memoryUsage() method in Node.js.

Example 1: 

index.js
// Importing console module
const console = require('console'); 

var a = 'GeeksforGeeks';

// Calling console.dirxml() function
console.dirxml(a)

Run the index.js file using the following command:

node index.js

Output:

GeeksforGeeks

Example 2: Create an index.js file with the following code.

index.js
// Importing console module
const console = require('console'); 

// Calling console.dirxml() function
console.dirxml("Hi there, Geeks")

Run the index.js file using the following command:

node index.js

Output:

Hi there, Geeks

Reference: https://nodejs.org/api/console.html#console_console_dirxml_data


Next Article

Similar Reads