Resource metadata returned by SessionStorage.stats() and PublicStorage.stats().
SessionStorage.stats()
PublicStorage.stats()
const stats = await pubky.publicStorage.stats(`${user}/pub/app/file.json`);if (stats) { console.log(stats.contentLength, stats.contentType, stats.lastModifiedMs);}Notes:- `contentLength` equals `getBytes(...).length`.- `etag` may be absent and is opaque; compare values to detect updates.- `lastModifiedMs` increases when the resource is updated. Copy
const stats = await pubky.publicStorage.stats(`${user}/pub/app/file.json`);if (stats) { console.log(stats.contentLength, stats.contentType, stats.lastModifiedMs);}Notes:- `contentLength` equals `getBytes(...).length`.- `etag` may be absent and is opaque; compare values to detect updates.- `lastModifiedMs` increases when the resource is updated.
Optional
Size in bytes.
Media type (e.g. "application/json; charset=utf-8").
Opaque server ETag for the current version.
Unix epoch milliseconds.
Resource metadata returned by
SessionStorage.stats()andPublicStorage.stats().Example