Node.js

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser:

https://www.tutorialspoint.com/nodejs/nodejs_first_application.htm

Node.js lets developers use JavaScript to write Command Line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user’s web browser. 

https://code.visualstudio.com/docs/nodejs/nodejs-tutorial

Node.js led to Callback Hell Which then was solved by the introduction of Node 7.6  Async/Await Support and “promises”

https://www.infoq.com/news/2017/02/node-76-async-await

=========================================

To get the data from node to a web browser,  use a RESTful node.js server, coupled with a client-side data-grid that communicates with a REST server.

This example uses dojo’s dGrid on the client and Express for a REST API on the server: http://www.sw-at.com/blog/2012/05/09/virtual-scrolling-with-dgrid-dojo-dgrid-node-js-and-mongodb/. It uses MongoDB, so you’ll need to replace those parts with the code you have to connect to an Oracle DB instead.

 
Another alternative is Backbone.Datagrid, which uses the client-side Backbone.js framework to communicate with a REST service: http://loicfrering.github.io/backbone.datagrid/. There are a lot of tutorials out there that details how to connect the Backbone client-side framework with various node.js REST servers (Express, Restify, etc).

Better client-side data grids : jqGrid and SlickGrid,  Here are a couple links on getting jqGrid working with a REST server: 

http://stackoverflow.com/questions/7344310/using-jqgrids-inline-editing-with-restful-urls

http://www.javacodegeeks.com/2011/07/jqgrid-rest-ajax-spring-mvc-integration.html

Good Grids:

Best inline editing with enter:  https://paramquery.com/demos/editing

has keyboard handling:    https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/handlekeyboard.htm

http://dgrid.io/

http://w2ui.com/web/demos/#!grid/grid-21

http://w2ui.com/kickstart/home

http://slickgrid.net/Index.html

https://www.primefaces.org/primereact/#/datatable/edit

http://ui-grid.info/

List of grids: https://codegeekz.com/best-javascript-data-grid-libraries/

List of grids: https://www.angularminds.com/blog/article/15-useful-javascript-based-data-grid-libraries-for-web-app-development.html

=====================================================

npm is a package manager for the JavaScript programming language.

It is the default package manager for the JavaScript runtime environment Node.js.

=====================================================
 
Express.js is a fast, non-opinionated, minimalist back end development web framework for Node.js.
Other frameworks are more abstract but slower than Express.js.
 

Assuming you’ve already installed Node.js, create a directory to hold your application, and make that your working directory.

$ mkdir amirapp
$ cd amirapp

Use the npm init command to create a package.json file for your application. For more information on how package.json works, see Specifics of npm’s package.json handling.

$ npm init

This command prompts you for a number of things, such as the name and version of your application.

Hit RETURN to accept the defaults for most of them, with the following exception:

entry point: (index.js)

Enter mirappindex.js, or whatever you want the name of the main file to be. If you want it to be index.js, hit RETURN to accept the suggested default file name.

Now install Express in the myapp directory and save it in the dependencies list.

$ npm install express –save

var amirexpressv =require(‘express’);

var amirapp=express();

 

=====================================
 
Hapi.is does a back end development framework like express.js but is more abstract. Express is closer to node.js itself.
===================================================================
Electron a open-source software framework that enables cross-platform desktop applications and handles the architecture of getting Node.js and Chromium to play together. Electron allows for the development of desktop GUI applications using Node.js run time for the back end and Chromium for the front end. 
 
=============================================================
https://www.altexsoft.com/blog/engineering/the-good-and-the-bad-of-node-js-web-app-development/
https://www.altexsoft.com/blog/engineering/the-good-and-the-bad-of-javascript-full-stack-development/

 

============================================================================================

Connection from Node.js to SQL

const mysql = require('mysql');
const pool  = mysql.createPool({
  host     : 'example.org',
  user     : 'bob',
  password : 'secret',
  database : 'my_db'
});
const getConnection = () => {
  return new Promise((resolve, reject) => {
      pool.getConnection(function(err, connection) {
        if (err) {
          reject(err);
        }
        else {
          resolve(connection);
        }
      });
  });
}
module.exports = {
  getConnection,
};

And you can get a connection from this pool like this:

getConnection().then((conn) => {
   conn.query(<your query>, (error, results, fields) => {
         // do things here;
         conn.release();
   });
})