How to write ‘Beautiful Life’ in Node.js ? Last Updated : 31 Mar, 2023 Comments Improve Suggest changes Like Article Like Report Node.js is an open-source and cross-platform runtime environment for executing JavaScript code outside a browser. You need to remember that NodeJS is not a framework and it’s not a programming language. Most people are confused and understand it’s a framework or a programming language. We often use Node.js for building back-end services like APIs like Web App or Mobile App. It’s used in production by large companies such as Paypal, Uber, Netflix, Walmart, and so on. Example: In this article, we will learn how to write "Beautiful Life" in Node.js. Create a .js file like we have created the geeksforgeeks.js file and write down the following code in it. Filename: geeksforgeeks.js JavaScript const http = require('http'); // Create a server object: http.createServer(function (request, response) { // Write a response to the client response.write('Beautiful Life'); // End the response response.end(); // The server object listens on port 8080 }).listen(8080); Step to run file: Open CMD and go to the folder directory where the above file is kept, then run the following command. node geeksforgeeks.jsOutput: Open any browser and go to http://localhost:8080/, you will see the following output. Comment More infoAdvertise with us Next Article How to write ‘Beautiful Life’ in Node.js ? A akshitsaxenaa09 Follow Improve Article Tags : Web Technologies Node.js Blogathon Blogathon-2021 NodeJS-Questions Node.js-HTTP-Module +2 More Similar Reads How to Work with 'word-count' Module in Node.js ? The word-count module is a lightweight and straightforward Node.js library designed to count words in a given text or string. It provides a convenient way to analyze text content programmatically, which can be useful in various applications such as text processing, analytics, and content management. 3 min read How to Setup View Engine in Node.js ? View engines are useful for rendering web pages. There are many view engines available in the market like Mustache, Handlebars, EJS, etc but the most popular among them is EJS which simply stands for Embedded JavaScript. It is a simple templating language/engine that lets its user generate HTML with 2 min read How to build Love Calculator using Node.js ? In this article, we are going to create a Love Calculator. A Love Calculator is used to calculate the love percentage between the partners. Functionality:Take User's NameTake User's Partner NameShow the Love PercentageApproach: We are going to use Body Parser by which we can capture user input value 5 min read How to add new functionalities to a module in Node.js ? Node.js is an open-source and cross-platform runtime environment built on Chromeâs V8 JavaScript engine for executing JavaScript code outside of a browser. You need to recollect that NodeJS isnât a framework, and itâs not a programming language. In this article, we will discuss how to add new functi 3 min read How to build your own CLI (Command Line Interface) with Node.js ? Introduction: A command-line interface (CLI) is a text-based user interface (UI) for running programs, managing files, and interacting with computers. Building your own CLI is easier than you might think with Node.js. There are a bunch of open-source packages that can handle color, animation, and us 2 min read How to use 'Kleur' Module in Node.js ? 'kleur' module is an external NPM module that can manage color properties in JavaScript applications or projects. It allows developers or programmers to manipulate and use colors in their projects. By using kleur, we change the colors of the outputs in the console which make it looks good.Installati 2 min read How to work with Node.js and JSON file ? Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. With node.js as backend, the developer can maintain a single codebase for an entire application in javaScript.JSON on the other hand, stands for JavaScript Object Notation. It is a lightweight format for storing and exchanging d 4 min read How to read and write JSON file using Node ? Node JS is a free and versatile runtime environment that allows the execution of JavaScript code outside of web browsers. It finds extensive usage in creating APIs and microservices, catering to the needs of both small startups and large enterprises.JSON(JavaScript Object Notation) is a simple and t 3 min read How to handle badwords in Node.js ? The bad-words module is used to handle the bad-words by cleaning the given string. It is a JavaScript filter for bad words. This module searches for profane words and replaces them with placeholder characters. Feature of bad-words module: It is easy to get started and easy to use.It is a widely use 2 min read Node.js Buffer.write() Method The Buffer.write() method writes the specified string into a buffer, at the specified position. If buffer did not contain enough space to fit the entire string, only part of string will be written. However, partially encoded characters will not be written. Syntax: buffer.write( string, offset, lengt 2 min read Like