I’m working on a project to do local caching using localStorage. I want it to work in both node.js as well as in the browser. I have a similar situation with my RallyAnalytics project where I use driverdan’s node-XMLHttpRequest as a drop-in replacement for the browser’s native XMLHttpRequest object. So, I decided that the best approach would be to build my caching mechanism on top of the localStorage interface. Since I couldn’t find one in the wild, I created node-localstorage. It might be useful for testing or you may have a situation like mine where you want to run the same code on the server/desktop as you run in the browser.
github repository (including usage and installation documentation)