{"id":24451,"date":"2019-04-16T12:15:22","date_gmt":"2019-04-16T09:15:22","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=24451"},"modified":"2019-04-15T11:53:17","modified_gmt":"2019-04-15T08:53:17","slug":"how-nodejs-processes-modules","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/","title":{"rendered":"How NodeJs Processes Modules?"},"content":{"rendered":"\n<p> We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. <\/p>\n\n\n\n<p>where<code>app.jsis<\/code> the entry point to our application.<\/p>\n\n\n\n<p>But seldom do we wonder about what\u2019s happening when we type this command. How does the node magically come to take our js file and executes it? This is exactly what we\u2019ll be discussing in this article.<\/p>\n\n\n\n<p>In another article, I described&nbsp;<a href=\"http:\/\/www.awasthiashish.com\/2019\/03\/v8-engine-and-introduction-to-nodejs.html\" target=\"_blank\" rel=\"noreferrer noopener\">how nodejs passes the js file to the V8 engine<\/a>&nbsp;and converts it into processor comprehensible language. There\u2019s a catch here. Node doesn\u2019t send the content of entry module(app.js) directly to V8. First, it processes this code and augments it by wrapping it inside a wrapper function as shown below.<\/p>\n\n\n\n<pre class=\"brush:php\">(function (exports, require, module, __filename, __dirname) {\n    \/\/ content of app.js\n});\n<\/pre>\n\n\n\n<p>After wrapping the code, Node passes it through V8 engine for compilation into m\/c code. So how does node accomplish that? What are the steps involved to achieve this? Let\u2019s talk about this in detail.<\/p>\n\n\n\n<p>It starts with&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L866\">runMain<\/a>&nbsp;function which is bootstrap main module (analogous to C++ main() function) for node (this is not the first function to execute actually. Call stack goes like listOnTimeout -&gt; tryOnTimeout -&gt; ontimeOut -&gt; Module.runMain \u2026.). When we type&nbsp;<code>node app.js<\/code>, the node environment executes this main module.<\/p>\n\n\n\n<pre class=\"brush:php\">...\n...\nModule._load(process.argv[1], null, true);\n...\n...\n<\/pre>\n\n\n\n<p>Here<code>process.argv[1]<\/code>corresponds to the string<code>\"app.js\"<\/code>.&nbsp; So basically node is being instructed to<code>_load<\/code>the file<code>app.js.<\/code><\/p>\n\n\n\n<p>In the&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L576\">Module._load<\/a>&nbsp;function,&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L596\">a new Module object is created<\/a>&nbsp;and then this module is passed to<code>tryModuleLoadfunction<\/code> for loading.<\/p>\n\n\n\n<pre class=\"brush:php\">var module = new Module(filename, parent);\n...\ntryModuleLoad(module, filename);\n<\/pre>\n\n\n\n<p><a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L613\">tryModuleLoad<\/a>&nbsp;loads the module.\n\n<\/p>\n\n\n\n<pre class=\"brush:php\">...\nmodule.load(filename)\n...\n<\/pre>\n\n\n\n<p><a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L673\">Module<\/a><a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L673\">function\u2019s&nbsp;load<\/a>&nbsp;performs a&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L680\">check<\/a>&nbsp;on the extension. If no extension is specified, it takes default extension to be&nbsp;.js\n\n<\/p>\n\n\n\n<pre class=\"brush:php\">...\nvar extension = findLongestRegisteredExtension(filename);\nModule._extensions[extension](this, filename);\n...\n<\/pre>\n\n\n\n<p>\nSince our file extension is<code>.js<\/code>,<code>Module._extension['.js']<\/code>will be called.\n<\/p>\n\n\n\n<pre class=\"brush:php\">var content = fs.readFileSync(filename, 'utf8');\nmodule._compile(stripBOM(content), filename);\n<\/pre>\n\n\n\n<p><a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L732\">Following<\/a>&nbsp;things happens in this function.\n\n<\/p>\n\n\n\n<pre class=\"brush:bash\">\/\/ Run the file contents in the correct scope or sandbox. Expose\n\/\/ the correct helper variables (require, module, exports) to the file.\n\/\/ Returns exception, if any.<\/pre>\n\n\n\n<p>Each module has <code>exports<\/code>, <code>require<\/code>, <code>module<\/code>, <code>__filename<\/code>, <code>__dirname<\/code>and <code>this<\/code>attached to it. <code>this<\/code> comes as per EcmaScript standard. <a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L804\">This<\/a>&nbsp;is where these properties are declared for this module. <\/p>\n\n\n\n<pre class=\"brush:php\">var dirname = path.dirname(filename);\nvar require = makeRequireFunction(this);\nvar result;\nvar exports = this.exports;\nvar thisValue = exports;\nvar module = this;\n<\/pre>\n\n\n\n<p>\n\nAnd then there is&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L746\">something<\/a>&nbsp;about wrapping the code,\n\n<\/p>\n\n\n\n<pre class=\"brush:php\">const wrapper = Module.wrap(content);\n<\/pre>\n\n\n\n<p>\n\nWe set to find out what Module.wrap does, which&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L134\">is<\/a>&nbsp;nothing but\n\n<\/p>\n\n\n\n<pre class=\"brush:php\">let wrap = function(script) {\n  return Module.wrapper[0] + script + Module.wrapper[1];\n};\nconst wrapper = [\n  '(function (exports, require, module, __filename, __dirname) { ',\n  '\\n});'\n];\n<\/pre>\n\n\n\n<p>This is how our programs have access to the magic variables<code>;exports<\/code>,<code>;require<\/code>,<code>module<\/code>,<code>__filename<\/code>, and<code>__dirname<\/code><\/p>\n\n\n\n<p>Now we can see how we\u2019ve got our wrapped function we talked about initially.<\/p>\n\n\n\n<p>Then this wrapped function is compiled and executed <a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L747\">here<\/a>&nbsp;with<code>runInThisContextde<\/code>fined in&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/vm.js\">vm.jsmodule<\/a><\/p>\n\n\n\n<pre class=\"brush:php\">compiledWrapper = vm.runInThisContext(wrapper, {\n      filename,\n      lineOffset: 0,\n      displayErrors: true,\n      importModuleDynamically: experimentalModules ? async (specifier) =&gt; {\n        if (asyncESM === undefined) lazyLoadESM();\n        const loader = await asyncESM.loaderPromise;\n        return loader.import(specifier, normalizeReferrerURL(filename));\n      } : undefined,\n});\n<\/pre>\n\n\n\n<p>\n\nThen finally the module\u2019s compiled wrapped function object is invoked like&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L814\">this<\/a>, with values populated for exports, require, module, __filename and __dirname\n\n<\/p>\n\n\n\n<pre class=\"brush:php\">result = compiledWrapper.call(thisValue, exports, require, module, filename, dirname);\n<\/pre>\n\n\n\n<p>\n\nThis value is then finally&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/blob\/ed2c6965d2f901f3c786f9d24bcd57b2cd523611\/lib\/internal\/modules\/cjs\/loader.js#L818\">returned<\/a><\/p>\n\n\n\n<pre class=\"brush:php\">return result;\n<\/pre>\n\n\n\n<p>I hope this would have provided you with a deep understanding of the node and the processes that happen under the loop.<\/p>\n\n\n\n<p>Keep learning!<\/p>\n\n\n\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Web Code Geeks with permission by Himansh Jain, partner at our <a href=\"\/\/www.webcodegeeks.com\/join-us\/wcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">WCG program<\/a>. See the original article here: <a href=\"http:\/\/www.awasthiashish.com\/2019\/03\/how-nodejs-processes-modules.html\" target=\"_blank\" rel=\"noopener noreferrer\">How NodeJs Processes Modules?<\/a><\/p>\n<p>Opinions expressed by Web Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry point to our application. But seldom do we wonder about what\u2019s happening when we type this command. How does the node magically come to take our js file &hellip;<\/p>\n","protected":false},"author":12696,"featured_media":924,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-24451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How NodeJs Processes Modules? - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry\" \/>\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\/how-nodejs-processes-modules\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How NodeJs Processes Modules? - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\" \/>\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=\"2019-04-16T09:15:22+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=\"Himansh Jain\" \/>\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=\"Himansh Jain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 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\/how-nodejs-processes-modules\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\"},\"author\":{\"name\":\"Himansh Jain\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4edd2a3a95a21e33a556b9f67be42685\"},\"headline\":\"How NodeJs Processes Modules?\",\"datePublished\":\"2019-04-16T09:15:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\"},\"wordCount\":491,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"articleSection\":[\"Node.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\",\"name\":\"How NodeJs Processes Modules? - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg\",\"datePublished\":\"2019-04-16T09:15:22+00:00\",\"description\":\"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#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\/how-nodejs-processes-modules\/#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\":\"How NodeJs Processes Modules?\"}]},{\"@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\/4edd2a3a95a21e33a556b9f67be42685\",\"name\":\"Himansh Jain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/817eafb54ed3311f0bbdea278a6acd240ceab2390ae7e6884338003811dbc831?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/817eafb54ed3311f0bbdea278a6acd240ceab2390ae7e6884338003811dbc831?s=96&d=mm&r=g\",\"caption\":\"Himansh Jain\"},\"description\":\"Works as the technical leader of an ADF Development team, An active member of OTN Jdev\/ADF Forum of Oracle Community. He has written more than 200 article about Oracle ADF and JDeveloper. Many of his articles got published in WebLogic community newsletter and Oracle ACE newsletter from time to time. Awarded with Oracle ACE title (\u2660\ufe0f) in the year 2015 for his contribution in Oracle Technology Network.\",\"sameAs\":[\"http:\/\/www.awasthiashish.com\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/himansh-jain\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How NodeJs Processes Modules? - Web Code Geeks - 2026","description":"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry","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\/how-nodejs-processes-modules\/","og_locale":"en_US","og_type":"article","og_title":"How NodeJs Processes Modules? - Web Code Geeks - 2026","og_description":"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2019-04-16T09:15:22+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":"Himansh Jain","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Himansh Jain","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/"},"author":{"name":"Himansh Jain","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4edd2a3a95a21e33a556b9f67be42685"},"headline":"How NodeJs Processes Modules?","datePublished":"2019-04-16T09:15:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/"},"wordCount":491,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","articleSection":["Node.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/","name":"How NodeJs Processes Modules? - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/nodejs-logo.jpg","datePublished":"2019-04-16T09:15:22+00:00","description":"We all know that to execute a node application, we have to type the command. In this post, we\u2019ll see how NodeJS processes Modules. whereapp.jsis the entry","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/node-js\/how-nodejs-processes-modules\/#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\/how-nodejs-processes-modules\/#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":"How NodeJs Processes Modules?"}]},{"@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\/4edd2a3a95a21e33a556b9f67be42685","name":"Himansh Jain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/817eafb54ed3311f0bbdea278a6acd240ceab2390ae7e6884338003811dbc831?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/817eafb54ed3311f0bbdea278a6acd240ceab2390ae7e6884338003811dbc831?s=96&d=mm&r=g","caption":"Himansh Jain"},"description":"Works as the technical leader of an ADF Development team, An active member of OTN Jdev\/ADF Forum of Oracle Community. He has written more than 200 article about Oracle ADF and JDeveloper. Many of his articles got published in WebLogic community newsletter and Oracle ACE newsletter from time to time. Awarded with Oracle ACE title (\u2660\ufe0f) in the year 2015 for his contribution in Oracle Technology Network.","sameAs":["http:\/\/www.awasthiashish.com\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/himansh-jain\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/24451","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\/12696"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=24451"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/24451\/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=24451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=24451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=24451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}