Expose the cache's current size as part of the API
- Dominant language
- JavaScript
- Stars
- 33
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
### Runtime
node.js
### Runtime version
22
### Module version
6.0.2
### Used with
another framework
### Any other relevant information
_No response_
### What problem are you trying to solve?
I'm working on a project that uses @hapi/catbox with @hapi/catbox-memory to cache some API calls on servers. As this caching is very important for the project we would like to improve our monitoring and be able to capture the size of the cache in our metrics.
### Do you have a new or modified API suggestion to solve the problem?
I've noticed that @hapi/catbox-memory has an internal `byteSize` property, but it's not exposed in the module's API (and not documented or included in the Typescript type definitions).
Would it be possible to expose this field? I would suggest a public `getCacheSize()` method for example.
I would happy to work on a pull request to add this, but wanted to make sure that not exposing this information was not by design.
Thank you!
Contributor guide
Assessment
This issue has not been assessed yet.