Test JS script file

Selected file: 01global_local.js
Compare console.log() outputs in browser and NodeJS.
Notice: Open browser's console in FireBUG!

  1. 01global_local.js

..:: Source code - 01global_local.js ::..

/**
 * global - async
 * local - synch
 */

console.log('global 1');

setTimeout(function(){
	console.log('global 2');
}, 2000);


console.log('global 3');
 

..:: NodeJS Console - 01global_local.js ::..

$ node 01global_local.js
global 1
global 3
global 2
$ps -aux | grep node (list all node processes)
sasa         849  0.5  0.5 1316864 85948 ?       Ssl  Oct08 283:57 node /home/sasa/regoch/regoch-www/server
sasa         880  0.4  0.5 1319240 87572 ?       Ssl  Oct08 236:15 node /home/sasa/dex8/dex8-www/server/index.js
sasa         890  0.5  0.5 11797800 84964 ?      Ssl  Oct08 335:14 node /home/sasa/mikosoft_hr/www-mikosoft-hr/server/index.js
sasa         903  0.7  0.4 1329652 81784 ?       Ssl  Oct08 432:03 node /home/sasa/mikosoft-info/api-mikosoft-info/starter.js
sasa         929  0.4  0.4 1300184 68536 ?       Ssl  Oct08 226:47 node /home/sasa/mikosoft-info/www-mikosoft-info/server/index.js
sasa         943  0.4  0.4 1300808 66428 ?       Ssl  Oct08 233:53 node /home/sasa/dex8/dex8-kiosk/server/index.js
sasa         980  0.6  0.5 11796724 82720 ?      Ssl  Oct08 365:30 node /home/sasa/mikosoft-info/dodo-mikosoft-info/server/index.js
sasa         981  0.7  0.6 1148036 103688 ?      Ssl  Oct08 395:54 node /home/sasa/voovuu/voovuu-api/starter.js
sasa        1039  0.9  1.4 11940148 239860 ?     Ssl  Oct08 556:01 node /home/sasa/voovuu/voovuu-pub/server/index.js
sasa     2044488  0.3  0.4 1298112 67140 ?       Ssl  Nov01  77:53 node /home/sasa/dex8/dex8-panel/server/index.js
sasa     2574087  0.3  0.4 11792920 76812 ?      Ssl  Nov08  42:31 node /home/sasa/@mikosoft/dodo-examples/server/index.js
sasa     2702010  0.4  0.6 22296696 99456 ?      Ssl  Nov10  35:44 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702011  0.3  0.4 1101556 67436 ?       Ssl  Nov10  31:48 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702018  0.3  0.4 1101420 67160 ?       Ssl  Nov10  31:51 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702019  0.3  0.4 1101540 67388 ?       Ssl  Nov10  31:50 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702046  0.9  0.7 22311780 124224 ?     Ssl  Nov10  84:57 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702047  0.3  0.4 1101540 66732 ?       Ssl  Nov10  32:07 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702088  0.3  0.4 1101544 66620 ?       Ssl  Nov10  31:51 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702089  0.3  0.4 1101544 67500 ?       Ssl  Nov10  31:48 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702137  0.3  0.4 1100888 66676 ?       Ssl  Nov10  31:38 node /home/sasa/dex8/dex8-worker/starter.js
sasa     2702139  0.4  0.6 22297196 101412 ?     Ssl  Nov10  36:14 node /home/sasa/dex8/dex8-worker/starter.js
sasa     3097623  1.1  0.8 11716736 131500 ?     Ssl  Nov13  45:04 node /home/sasa/dex8/dex8-api/starter.js
www-data 3374827  0.0  0.0   2608   604 ?        S    11:07   0:00 sh -c ps -aux | grep node
www-data 3374829  0.0  0.0   3304   720 ?        S    11:07   0:00 grep node