Hey libuv, can you please read this file for me? Oh and when you are done, call cbSettingsRead
// Load the filesystem library
var fs = require('fs')
function readSettingsFile() {
// Write code to read the file.
// Callback called once done.
fs.readFile("settings.json", cbSettingsRead);
}
function cbSettingsRead(err, data) {
if(err) {
// There was an error while
// reading the file.
} else {
// File was read, update the settings.
}
}
function initDefaultSettings() {
// Initialize default settings.
}
readSettingsFile();
initDefaultSettings();
OK, sure!
Send it over.