Skip to content

Commit

Permalink
Saves current data.
Browse files Browse the repository at this point in the history
  • Loading branch information
exupero committed Sep 4, 2011
1 parent 64adb98 commit b31c50a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions app.js
Expand Up @@ -61,6 +61,14 @@ fs.readFile(process.argv[2], function(err, data) {
global.todos = data.todos;
global.done = data.done;
global.scores = data.scores;

setInterval(function() {
fs.writeFile(process.argv[2], JSON.stringify({
todos: global.todos,
done: global.done,
scores: global.scores
}, null, 2));
}, 1000);
});

// Functions
Expand Down
12 changes: 6 additions & 6 deletions data.json
Expand Up @@ -3,14 +3,14 @@
{
"text": "Join the adventure.",
"points": 3,
"assigned": ["Everyone"],
"assigned": [
"Merv"
],
"due": "Tuesday"
}
],
"done": [

],
"done": [],
"scores": {
"Mike": 3
"Merv": 0
}
}
}

0 comments on commit b31c50a

Please sign in to comment.