Question: What is NodeJS?
Node.js is a server-side platform.
Question: On which engine built on NodeJS??
Node.js is is built on Google Chrome's JavaScript Engine(V8).
Question: What type of application can be built using NodeJS?
- server-side application
- networking applications
Question: On which OS it can be run?
- OS X (Mac)
- Microsoft Windows
- Linux
Question: In what type of application we can use NodeJS?
- I/O bound Applications
- Data Streaming Applications
- Data Intensive Real-time Applications (DIRT)
- JSON APIs based Applications
- Single Page Applications
Question: What is REPL?
REPL is environment to test/debug the code of nodeJS.
Full form of REPL is Read Eval Print Loop.
Question: What is package.json?
package.json define the properties of a package like name, description, version, author, contributors and dependencies.
Question: Where does exist package.json in package?
It exist in root folder of every package.
Question: How to create an API in nodeJS?
var mysql = require("mysql"); var app = require('express')(); var http = require('http').Server(app); var con = mysql.createConnection('mysql://arun:arun@localhost/enterprisedev2'); app.get('/get/records', function(req, res) { con.query('SELECT id,userName,text FROM users where usertype=3', function(err, rows) { res.send(rows); }); });
Question: How to escape a string while insert into database?
var mysql = require("mysql"); mysql.escape('userdata');