{"id":1753,"date":"2024-02-05T13:30:33","date_gmt":"2024-02-05T13:30:33","guid":{"rendered":"https:\/\/www.devopsfreelancer.com\/blog\/?p=1753"},"modified":"2024-02-27T13:34:35","modified_gmt":"2024-02-27T13:34:35","slug":"what-is-node-js-explaination","status":"publish","type":"post","link":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/","title":{"rendered":"What is Node JS Explaination ?"},"content":{"rendered":"\n<p>Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. It is built on Chrome&#8217;s V8 JavaScript engine and allows developers to run JavaScript on the server-side, enabling the development of scalable and high-performance network applications. Node.js uses an event-driven, non-blocking I\/O model, which makes it lightweight and efficient, suitable for building real-time applications like web servers, chat applications, APIs, and more. Additionally, Node.js has a vast ecosystem of libraries and frameworks available via npm (Node Package Manager), making it a popular choice for developers for building various types of applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advantage of Nodejs<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open source<\/li>\n\n\n\n<li>Efficient Fast and highly scalable<\/li>\n\n\n\n<li>Event Driven<\/li>\n\n\n\n<li>Very popular<\/li>\n<\/ol>\n\n\n\n<p>Example:- <\/p>\n\n\n\n<p>Let&#8217;s create a simple HTTP server using Node.js. This server will listen for incoming HTTP requests and respond with a basic &#8220;Hello, World!&#8221; message.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Import the 'http' module\r\nconst http = require('http');\r\n\r\n\/\/ Define the hostname and port number\r\nconst hostname = '127.0.0.1';\r\nconst port = 3000;\r\n\r\n\/\/ Create a server\r\nconst server = http.createServer((req, res) => {\r\n  \/\/ Set the response header\r\n  res.writeHead(200, { 'Content-Type': 'text\/plain' });\r\n  \r\n  \/\/ Send the response body (Hello, World!)\r\n  res.end('Hello, World!\\n');\r\n});\r\n\r\n\/\/ Start the server and make it listen on the specified hostname and port\r\nserver.listen(port, hostname, () => {\r\n  console.log(`Server running at http:\/\/${hostname}:${port}\/`);\r\n});\r\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">In this example:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We import the built-in <code>http<\/code> module, which allows us to create an HTTP server.<\/li>\n\n\n\n<li>We define the hostname and port number on which our server will listen for incoming requests.<\/li>\n\n\n\n<li>We create an HTTP server using the <code>http.createServer()<\/code> method. This method takes a callback function that will be called whenever a request is received by the server.<\/li>\n\n\n\n<li>Inside the callback function, we set the response header using <code>res.writeHead()<\/code> and send the response body with <code>res.end()<\/code>.<\/li>\n\n\n\n<li>Finally, we start the server by calling <code>server.listen()<\/code> and passing it the port, hostname, and a callback function to be executed once the server starts.<\/li>\n<\/ol>\n\n\n\n<p>When you run this Node.js script, it will start an HTTP server on <code><strong>http:\/\/localhost:3000\/<\/strong><\/code>. If you visit this URL in a web browser or make a request using tools like cURL or Postman, you&#8217;ll receive the response &#8220;Hello, World!&#8221; from the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. It is built on Chrome&#8217;s V8 JavaScript engine and allows&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[691],"tags":[692,693,694],"class_list":["post-1753","post","type-post","status-publish","format-standard","hentry","category-nodejs","tag-nodejs","tag-nodejs-installation","tag-nodejs-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Node JS Explaination ? - DevOps Freelancer<\/title>\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.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Node JS Explaination ? - DevOps Freelancer\" \/>\n<meta property=\"og:description\" content=\"Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. It is built on Chrome&#8217;s V8 JavaScript engine and allows...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Freelancer\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/amitsthakurs\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-05T13:30:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-27T13:34:35+00:00\" \/>\n<meta name=\"author\" content=\"Amit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/amits_thakurs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amit Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/\"},\"author\":{\"name\":\"Amit Kumar\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"headline\":\"What is Node JS Explaination ?\",\"datePublished\":\"2024-02-05T13:30:33+00:00\",\"dateModified\":\"2024-02-27T13:34:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/\"},\"wordCount\":291,\"commentCount\":0,\"keywords\":[\"nodejs\",\"nodejs-installation\",\"nodejs-server\"],\"articleSection\":[\"nodejs\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/\",\"name\":\"What is Node JS Explaination ? - DevOps Freelancer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-02-05T13:30:33+00:00\",\"dateModified\":\"2024-02-27T13:34:35+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/what-is-node-js-explaination\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Node JS Explaination ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\",\"name\":\"DevOps Freelancer\",\"description\":\"We provide DevOps | SRE | DevSecOps | MLOps Freelancing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"caption\":\"Amit Kumar\"},\"description\":\"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\\\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/amitsthakurs\\\/\",\"https:\\\/\\\/www.instagram.com\\\/amits_thakurs\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/amits-thakurs\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/amits_thakurs\"],\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/author\\\/amit\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Node JS Explaination ? - DevOps Freelancer","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.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/","og_locale":"en_US","og_type":"article","og_title":"What is Node JS Explaination ? - DevOps Freelancer","og_description":"Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. It is built on Chrome&#8217;s V8 JavaScript engine and allows...","og_url":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/","og_site_name":"DevOps Freelancer","article_author":"https:\/\/www.facebook.com\/amitsthakurs\/","article_published_time":"2024-02-05T13:30:33+00:00","article_modified_time":"2024-02-27T13:34:35+00:00","author":"Amit Kumar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/amits_thakurs","twitter_misc":{"Written by":"Amit Kumar","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/#article","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/"},"author":{"name":"Amit Kumar","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"headline":"What is Node JS Explaination ?","datePublished":"2024-02-05T13:30:33+00:00","dateModified":"2024-02-27T13:34:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/"},"wordCount":291,"commentCount":0,"keywords":["nodejs","nodejs-installation","nodejs-server"],"articleSection":["nodejs"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/","url":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/","name":"What is Node JS Explaination ? - DevOps Freelancer","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website"},"datePublished":"2024-02-05T13:30:33+00:00","dateModified":"2024-02-27T13:34:35+00:00","author":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"breadcrumb":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopsfreelancer.com\/blog\/what-is-node-js-explaination\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopsfreelancer.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is Node JS Explaination ?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website","url":"https:\/\/www.devopsfreelancer.com\/blog\/","name":"DevOps Freelancer","description":"We provide DevOps | SRE | DevSecOps | MLOps Freelancing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsfreelancer.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b","name":"Amit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","caption":"Amit Kumar"},"description":"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.","sameAs":["https:\/\/www.facebook.com\/amitsthakurs\/","https:\/\/www.instagram.com\/amits_thakurs\/","https:\/\/www.linkedin.com\/in\/amits-thakurs\/","https:\/\/x.com\/https:\/\/twitter.com\/amits_thakurs"],"url":"https:\/\/www.devopsfreelancer.com\/blog\/author\/amit\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=1753"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1753\/revisions"}],"predecessor-version":[{"id":1755,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1753\/revisions\/1755"}],"wp:attachment":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=1753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=1753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=1753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}