// In this specific case this always answers that the file doesn't exist
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}
if(localStorage.getItem(filename)!==null){
returncallback(true);
}else{
returncallback(false);
}
}
functionrename(filename,newFilename,callback){
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}
// Options do not matter in browser setup
if(typeofoptions==='function'){callback=options;}
varcontents=localStorage.getItem(filename)||'';
contents+=toAppend;
localStorage.setItem(filename,contents);
returncallback();
}
functionreadFile(filename,options,callback){
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}
if(typeoflocalStorage==='undefined'){console.log("WARNING - This browser doesn't support localStorage, no data will be saved in NeDB!");returncallback();}