-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.js
39 lines (34 loc) · 868 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* This file contains initiation steps
* author (Aravindh.N <aravindh.nagarajan@hotmail.com>)
*/
var fileSystem = require('./fileSystem.js');
var pss= require('./process.js');
var utils = require('./util.js');
/*
* Function to read contents
* param {string} path - {Path of the input file to be read}
*/
var readContents = function(path){
fileSystem.readUtil(path,function(err,data){
if(err){
console.log(err);
return;
}else{
init(data);
}
});
};
/*
* Function that starts execution of the processes
* param {String} data - {data from input file}
*/
var init = function(data){
var data = utils.toArray(data);
var startTime = fileSystem.getStartTime();
pss.start(startTime,data);
};
/* Gets file path*/
var path = fileSystem.getFilePath();
/* Reads content */
readContents(path);