WPM
100
CPM
100
Errors
0
Time
15Min
Accuracy
100%
Start NodeJs code typing Practice. Creating Server in NodeJs, Testing Request and Response, Accept Input from command line, Properties of Object and Output to Command Line in NodeJs.Click on the area below to start typing.

S.No.Paragraph : Practice repeatedly whatever you would like most for full fifteen minutes Lessionsclick to Practice
1http.createServer(function (request, response) { // Send the HTTP header // HTTP Status: 200 : OK // Content Type: text/plain response.writeHead(200, {'Content-Type': 'text/plain'}); // Send the response body as "Hello World" response.end('Hello World\n'); }).listen(8081); // Console will print the message console.log('Server running at http://127.0.0.1:8081/');1.1 first program creating server in node.js
2var http = require("http"); http.createServer(function (request, response) { // Send the HTTP header // HTTP Status: 200 : OK // Content Type: text/plain response.writeHead(200, {'Content-Type': 'text/plain'}); // Send the response body as "Hello World" response.end('Hello World\n'); }).listen(8081); // Console will print the message console.log('Server running at http://127.0.0.1:8081/');1.2 testing request and response in node.js
3const readline = require('readline').createInterface({ input: process.stdin, output: process.stdout, }); readline.question('What's your name?', name => { console.log('Hi ${name}!'); readline.close(); }); const inquirer = require('inquirer'); const questions = [ { type: 'input', name: 'name', message: "What's your name?", }, ]; inquirer.prompt(questions).then(answers => { console.log('Hi ${answers.name}!'); });1.3 Accept input from the command line in Node.js
4// car.js exports.car = { brand: 'Ford', model: 'Fiesta', }; module.exports = { brand: 'Tesla', model: 'Model S', }; // app.js const tesla = require('./car'); const ford = require('./car').car; console.log(tesla, ford);1.4 properties of objects node.js points to
5const oranges = ['orange', 'orange']; const apples = ['just one apple']; oranges.forEach(fruit => { console.count(fruit); }); apples.forEach(fruit => { console.count(fruit); }); console.countReset('orange'); oranges.forEach(fruit => { console.count(fruit); });1.5 Output to the command line using node.js