Just saw this article at tinyMMO while trying to load crafty.js correctly and it goes over some of the stuff in "on demand systems" like the Wayfar object $ods, when procedurally generating and destroying similiar bits (like rooms in the same biome), but for javascript games. Anyway, here's the article at tinyMMO - Tile Maps of Unusual Size. Great breakdown!
Node.JS Requires reference
Node & Couch on IrisCouch Cloud reference