# length

#####

property
hoodie.store.length

number of stored items.

    localStorageMemory.length = 0

# getItem

#####

method
hoodie.store.getItem()

returns item for passed key, or null

    localStorageMemory.getItem = function (key) {
      return cache[key] || null
    }

# setItem

#####

method
hoodie.store.setItem()

sets item for key to passed value, as String

    localStorageMemory.setItem = function (key, value) {
      if (typeof value === 'undefined') {
        localStorageMemory.removeItem(key)
      } else {
        if (!(cache.hasOwnProperty(key))) {
          localStorageMemory.length++
        }

        cache[key] = '' + value
      }
    }

# removeItem

#####

method
hoodie.store.removeItem()

removes item for passed key

    localStorageMemory.removeItem = function (key) {
      if (cache.hasOwnProperty(key)) {
        delete cache[key]
        localStorageMemory.length--
      }
    }

# key

#####

method
hoodie.store.key()

returns name of key at passed index

    localStorageMemory.key = function (index) {
      return Object.keys(cache)[index] || null
    }

# clear

#####

method
hoodie.store.clear()

removes all stored items and sets length to 0

    localStorageMemory.clear = function () {
      cache = {}
      localStorageMemory.length = 0
    }

    if (typeof exports === 'object') {
      module.exports = localStorageMemory
    } else {
      root.localStorageMemory = localStorageMemory
    }
    })(this)