lib/storage.js
function(location, name) {
  this.location = location;
  this.name = name;
  if (typeof localStorage === 'undefined' || localStorage === null) {
    if (this.name) {
      this.name = require('sanitize-filename')(this.name, {replacement: '_'});
      require('mkdirp').sync(this.location);
    }
  }
  else {
    this.localStorage = localStorage;
  }
  this.path = this.location;
  if (this.name)
    this.path += '/' + this.name;
}
function(location, name) {
  this.location = location;
  this.name = name;
  if (typeof localStorage === 'undefined' || localStorage === null) {
    if (this.name) {
      this.name = require('sanitize-filename')(this.name, {replacement: '_'});
      require('mkdirp').sync(this.location);
    }
  }
  else {
    this.localStorage = localStorage;
  }
  this.path = this.location;
  if (this.name)
    this.path += '/' + this.name;
}
function ( location , name ) { this . location = location ; this . name = name ; if ( typeof localStorage === 'undefined' || localStorage === null ) { if ( this . name ) { this . name = require ( 'sanitize-filename' ) ( this . name , { replacement : '_' } ) ; require ( 'mkdirp' ) . sync ( this . location ) ; } } else { this . localStorage = localStorage ; } this . path = this . location ; if ( this . name ) this . path += '/' + this . name ; }
Abstracts storage to file system or html5 localStorage. name is optional
Abstracts storage to file system or html5 localStorage . name is optional