- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
process.argv0() Method in Node.js
The process.argv0() method is used for storing the read-only copy of the original value for argv[0] that is passed when the node.js application is started.
Syntax
process.argv0()
Parameters
Since it returns only the read-only copy for stored value of argv[0]. It does not need any inputs from the user.
Example
Create a file with name – argv0.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −
node argv0.js
argv0.js
// Node.js program to demonstrate the use of process.argv0 // Importing the process module const process = require('process'); // Printing argv0 value for the process console.log(process.argv0);
Output
C:\home
ode>> node argv0.js node
Example
Let's take a look at one more example.
// Node.js program to demonstrate the use of process.argv0 // Importing the process module const process = require('process'); // Printing property value for process.argv0 console.log(process.argv[0]);
Output
C:\home
ode>> node argv0.js /usr/bin/node
Advertisements