createStorage = (storageDir, dirCacheSize = 12) => {
  const mediaCache = createMediaCache(storageDir, dirCacheSize)
  const entryCache = storageReadEntryFilesCached(storageDir, 2)

  /**
   * @type Storage
   */
  return {
    /**
     * @param {any} entry
     * @param {function} cb
     */
    readEntryFiles(entry, cb) {
      entryCache.readEntryFiles(entry, cb)
    },
    /**
     * Write all media to cache file
     *
     * @param {any[]} media List of media
     * @param {function} cb
     */
    updateMediaCache(media, cb) {
      if (!media.length) {
        return cb(null, media)
      }
      const firstMedia = media[0]
      const cacheFilename = getMediaCacheFilename(firstMedia)
      storageUpdateMediaCache(storageDir, cacheFilename, media, cb)
    },
    /**
     * Read single media from cache
     *
     * @param {any} slimMedia Singe media
     * @param {function} cb Error or media object from cache
     */
    readMediaCache(slimMedia, cb) {
      mediaCache.getItem(slimMedia, (errCause, cache) => {
        if (errCause) {
          return cb(new Error(`Failed to read meadia cache for ${slimMedia}`, {cause: errCause}))
        }

        const {index, filename} = slimMedia.files[0] || {}
        const cacheKey = `${index}:${filename || 'unknownFile'}`
        if (!cache.data[cacheKey]) {
          return cb(new Error(`Media ${slimMedia} not found in cache`))
        }

        cb(null, cache.data[cacheKey])
      })
    },
    clearCache() {
      entryCache.clearCache()
      mediaCache.clear()
    }
  }
}
@param {string} storageDir
@param {number} dirCacheSize
@returns {Storage}