Skip to content
Related Articles

Related Articles

Node.js process.argv0 Property

Improve Article
Save Article
Like Article
  • Last Updated : 12 Oct, 2021

The process.argv0 property is an inbuilt application programming interface of the process module which is used to get the read-only copy of the original value of argv[0] passed to the node.js process when running the command line.

Syntax:

process.argv0

Return Value: This property returns a string that specifies the first argument passed to the process when running in the command line.

Below examples illustrate the use of process.argv0 property in Node.js:

Example:




// Node.js program to demonstrate the
// process.argv0 Property
   
// Include process module
const process = require('process');
  
// Printing process.argv0 property value
console.log(process.argv0);

Output:

node.exe

Note: The above program will compile and run by using the node filename.js command.

Reference: https://nodejs.org/api/process.html#process_process_argv0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!