foam-framework / foam

Feature-Oriented Active Modeller
Apache License 2.0
786 stars 55 forks source link

node.js should load localstorage if the person has added it to their environment #350

Open anicolao opened 9 years ago

anicolao commented 9 years ago

The required block in core/node.js is something like

if (typeof localStorage === "undefined" || localStorage === null) {
  var l = require('node-localstorage').LocalStorage;
  if (l) {
    global.localStorage = new l("./localstorage");
  }
}