-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdriver.js
More file actions
36 lines (33 loc) · 773 Bytes
/
driver.js
File metadata and controls
36 lines (33 loc) · 773 Bytes
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
var semper = require('./semper');
var fs = require('fs');
var sample_data = {
laugh: 'haha',
person: {
home_address: {
street: "Hill St",
suburb: "Roseville",
},
given_name: "Joe",
family_name: "Smith",
birth_date: null,
enrolled_units: [
"Algorithms",
"Data Processing"
]
}
};
var verbose = false;
process.argv.slice(2).forEach(function (val, index, array) {
switch (val) {
case '-v': verbose = true; break;
default:
fs.readFile(val, function(err, contents) {
if (err)
throw err;
var parsed = semper.parse(contents.toString());
if (verbose) console.log(parsed);
var expanded = semper.expand(parsed, null, 'option1', sample_data);
console.log(expanded);
});
}
});