Dex TypeScript SDK 1.28.1
    Preparing search index...

    Function openBlobCache

    • Opens or creates a native BlobCache owned by the caller.

      Parameters

      • config: BlobCacheConfig

        Directory, positive byte capacity, and optional counter count.

      Returns BlobCache

      An open cache that must be closed at application shutdown.

      const cache = openBlobCache({ directory: ".dex-cache", maxBytes: 64 * 1024 ** 2 });
      try { cache.put("blob-1", new Uint8Array([1, 2])); } finally { cache.close(); }

      TypeError when the directory is empty.

      RangeError when a numeric setting is invalid.