{"id":19994,"date":"2018-01-15T16:15:15","date_gmt":"2018-01-15T14:15:15","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=19994"},"modified":"2018-01-15T11:27:10","modified_gmt":"2018-01-15T09:27:10","slug":"node-js-command-line-arguments-tutorial","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/","title":{"rendered":"Node.js Command Line Arguments Tutorial"},"content":{"rendered":"<p>In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through the Command Line to Node. Node.js has created quite a buzz in recent times and has won over thousands of developers who are using their knowledge of JavaScript for server side development. So let us get familiar with a feature of this platform.<\/p>\n<h2>1. Tools &amp; Technologies<\/h2>\n<p>I have used the following toolset to build our sample application. In case you feel more comfortable with some other tools available out there then you can switch out to those.<\/p>\n<ol>\n<li><a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noopener\">Node.js<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/express\" target=\"_blank\" rel=\"noopener\">Express<\/a><\/li>\n<li><a href=\"https:\/\/code.visualstudio.com\/download\" target=\"_blank\" rel=\"noopener\">Visual Studio Code IDE<\/a><\/li>\n<\/ol>\n<p>[ulp id=&#8217;7Yp6ijpjjxyeaN8A&#8217;]<br \/>\n&nbsp;<br \/>\nOn the Node.js Website you should see two versions listed. One of them an LTS one and a Current. You should install the LTS version as it is recommended for most users. The LTS version at the time of writing this was v8.9.4. Once you download and install Node, you can go to the command line and run the following commands to make sure things are setup properly.<\/p>\n<pre class=\"brush: bash;\">&gt; node -v\r\n<\/pre>\n<p>This should return the version of Node installed if everything went well.<\/p>\n<pre class=\"brush: bash;\">&gt; v8.9.4\r\n<\/pre>\n<p>The download in addition to installing Node will install npm and to check for it you can run the following command.<\/p>\n<pre class=\"brush: bash;\">&gt; npm -v\r\n<\/pre>\n<p>This will return the version of npm like below:<\/p>\n<pre class=\"brush: bash;\">&gt; v5.6.0\r\n<\/pre>\n<h2>2. Project Layout<\/h2>\n<p>The layout of the project looks like the below screen grab:<\/p>\n<figure id=\"attachment_20444\" aria-describedby=\"caption-attachment-20444\" style=\"width: 364px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectLayoutNodeCMDLine.jpg\"><img decoding=\"async\" class=\"size-full wp-image-20444\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectLayoutNodeCMDLine.jpg\" alt=\"\" width=\"364\" height=\"349\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectLayoutNodeCMDLine.jpg 364w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectLayoutNodeCMDLine-300x288.jpg 300w\" sizes=\"(max-width: 364px) 100vw, 364px\" \/><\/a><figcaption id=\"caption-attachment-20444\" class=\"wp-caption-text\">Project Layout<\/figcaption><\/figure>\n<h2>3. Command Line Arguments<\/h2>\n<p>Now that we have dealt with basic setup issues, let us now move on to the business at hand. Node.js exposes a global <code>process<\/code> object and this object has a <code>argv<\/code> property which allows access to the command line arguments. The property is an array and we can loop over it to access the arguments. So let us implement the same in our <code>index.js<\/code> file. After making changes the code should look like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>index.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">var express = require(\"express\");\r\nvar app = express();\r\nvar hostname = \"127.0.0.1\";\r\nvar port = 8090;\r\n\r\n\/\/Reading command line arguments and printing them to console\r\nprocess.argv.forEach(function(value, index){\r\n   console.log(value);\r\n});\r\n\r\napp.use(express.static('.'));\r\n\r\napp.listen(port, hostname);\r\n<\/pre>\n<p>When we run this code with a command similar to <code>node index.js WCG Post By Siddharth Seth<\/code> we should see the following output:<\/p>\n<figure id=\"attachment_20452\" aria-describedby=\"caption-attachment-20452\" style=\"width: 673px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectOutputSample.jpg\"><img decoding=\"async\" class=\"size-full wp-image-20452\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectOutputSample.jpg\" alt=\"\" width=\"673\" height=\"244\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectOutputSample.jpg 673w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ProjectOutputSample-300x109.jpg 300w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/a><figcaption id=\"caption-attachment-20452\" class=\"wp-caption-text\">Project Output<\/figcaption><\/figure>\n<p>The first argument is the <code>execPath<\/code>, the location of Node.js. Followed by the path to the file being executed. These are followed by the command line arguments that we passed in.<br \/>\nOne use for this could be launching an application in Dev vs Prod mode. Dev meaning development mode and the Prod mode for Production mode. We could use this for a wide variety of scenarios. In case the keyword dev is passed in we could run all our test cases as opposed to prod mode which could completely skirt around the test cases. We create a file named <code>example.js<\/code> which looks as follows.<br \/>\n<em>example.js<\/em><\/p>\n<pre class=\"brush: js;\">var express = require(\"express\");\r\nvar tests = require(\".\/tests\");\r\nvar app = express();\r\nvar hostname = \"127.0.0.1\";\r\nvar port = 8090;\r\n\r\n\/\/Reading command line arguments and printing them to console\r\nprocess.argv.forEach(function(value, index){\r\n   if(value === \"dev\"){\r\n       console.log(tests.runTests());\r\n   }\r\n});\r\n\r\napp.use(express.static('.'));\r\n\r\napp.listen(port, hostname);\r\n<\/pre>\n<p>An implementation of this could look like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>example.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">var express = require(\"express\");\r\nvar tests = require(\".\/tests\");\r\nvar app = express();\r\nvar hostname = \"127.0.0.1\";\r\nvar port = 8090;\r\n\r\n\/\/Reading command line arguments and printing them to console\r\nprocess.argv.forEach(function(value, index){\r\n   if(value === \"dev\"){\r\n       console.log(tests.runTests());\r\n   }\r\n});\r\n\r\napp.use(express.static('.'));\r\n\r\napp.listen(port, hostname);\r\n<\/pre>\n<p>This is very similar to our <code>index.js<\/code> file but it has a important difference as it looks for the keyword &#8220;dev&#8221;. Upon finding it the module runs tests found in another file <code>tests.js<\/code> and outputs the results from there. The test.js file looks like below:<br \/>\n<em>tests.js<\/em><\/p>\n<pre class=\"brush: js;\">function runTests(){\r\n    return \"All tests passed!\";\r\n}\r\nmodule.exports.runTests = runTests;\r\n<\/pre>\n<p>As you can see from the above examples that this is a pretty nifty feature. When we execute the application using command <code>node example.js dev<\/code>, we should see the following output:<\/p>\n<figure id=\"attachment_20481\" aria-describedby=\"caption-attachment-20481\" style=\"width: 662px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ExampleTestsNodejs.jpg\"><img decoding=\"async\" class=\"size-full wp-image-20481\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ExampleTestsNodejs.jpg\" alt=\"\" width=\"662\" height=\"139\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ExampleTestsNodejs.jpg 662w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/ExampleTestsNodejs-300x63.jpg 300w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><\/a><figcaption id=\"caption-attachment-20481\" class=\"wp-caption-text\">Project Output<\/figcaption><\/figure>\n<h2>4. Running the Code<\/h2>\n<p>To run our application we need to execute the following command in a command window at the root of the project:<\/p>\n<pre class=\"brush: bash;\">&gt; npm install\r\n<\/pre>\n<p>then<\/p>\n<pre class=\"brush: bash;\">&gt; node index.js argument1, argument2,...\r\n<\/pre>\n<h2>5. Download the Source Code<\/h2>\n<p>This wraps up our look at Node.js Command Line Arguments Tutorial.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/01\/WCG-Node.js-Command-Line-Arguments-Tutorial.zip\"><strong>WCG &#8212; Node.js Command Line Arguments Tutorial<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through the Command Line to Node. Node.js has created quite a buzz in recent times and has won over thousands of developers who are using their knowledge &hellip;<\/p>\n","protected":false},"author":213,"featured_media":924,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[347],"class_list":["post-19994","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-js","tag-nodejs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-15T14:15:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\"},\"headline\":\"Node.js Command Line Arguments Tutorial\",\"datePublished\":\"2018-01-15T14:15:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\"},\"wordCount\":621,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"keywords\":[\"nodejs\"],\"articleSection\":[\"Node.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\",\"name\":\"Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"datePublished\":\"2018-01-15T14:15:15+00:00\",\"description\":\"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Node.js\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/node-js\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Node.js Command Line Arguments Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\/\/www.webcodegeeks.com\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026","description":"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026","og_description":"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2018-01-15T14:15:15+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592"},"headline":"Node.js Command Line Arguments Tutorial","datePublished":"2018-01-15T14:15:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/"},"wordCount":621,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","keywords":["nodejs"],"articleSection":["Node.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/","name":"Node.js Command Line Arguments Tutorial - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","datePublished":"2018-01-15T14:15:15+00:00","description":"In this post we will take a look at how to process Command Line Arguments in Node.js. Specifically we will look at how to handle input passed in through","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/node-js-command-line-arguments-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Node.js","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/node-js\/"},{"@type":"ListItem","position":4,"name":"Node.js Command Line Arguments Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.webcodegeeks.com"],"url":"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/19994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/213"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=19994"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/19994\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/924"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=19994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=19994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=19994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}