@harsh_nesari/weakstore
v1.0.0
Published
A lightweight library for storing private data with multiple keys per object using WeakMap.
Maintainers
Readme
WeakStore
A lightweight library for storing private data for objects using WeakMap.
Why WeakStore?
In JavaScript, objects do not have built-in private fields (unless using classes with #private).
Sometimes you want to attach sensitive or hidden data to an object without exposing it publicly.
WeakStore solves this by:
- Safely storing multiple "private keys" per object.
- Ensuring memory safety (data is automatically garbage collected when objects are gone).
- Simplifying the use of
WeakMapwith a clean and easy API. - Making your code cleaner and easier to maintain.
Installation
npm install weakstore