Skip to content

Instantly share code, notes, and snippets.

@MoreOutput
Created January 14, 2013 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MoreOutput/fc34157a926b6de85139 to your computer and use it in GitHub Desktop.
Save MoreOutput/fc34157a926b6de85139 to your computer and use it in GitHub Desktop.
Room.prototype.getArea = function(areaName, fn) {
this.checkArea(areaName, function(fnd, area) {
if (fnd) {
return fn(area);
} else {
fs.readFile('./areas/' + areaName + '.json', function (err, area) {
var i = 0,
area = JSON.parse(area);
return fn(area);
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment