Normalizes local-storage behavior between node and browser