Call the library methods

This commit is contained in:
Ionică Bizău 2015-01-25 21:48:59 +02:00
parent 8b57202cf1
commit 708106f90f

View file

@ -1,2 +1,22 @@
#!/usr/bin/env node
var GitStats = require("../lib");
switch (process.argv[2]) {
case "--record":
var data = process.argv[3];
try {
data = JSON.parse(data);
} catch (e) {
throw e;
}
GitStats.record(data, function (err) {
if (err) { throw err; }
});
break;
default:
GitStats.get(function (err, data) {
console.log(err || data);
});
break;
}