
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@axtk/volatile-storage
Advanced tools
A storage with a customizable item lifetime and capacity with a localStorage-like API
A storage with a customizable item lifetime and capacity with a localStorage-like API
class VolatileStorage
const VolatileStorage = require('@axtk/volatile-storage');
const storage = new VolatileStorage({
storage: window.localStorage,
maxAge: 60000, // in milliseconds
capacity: 100
});
await storage.setItem('x', 1);
await storage.setItem('status', 'done', {maxAge: 120000});
let x = await storage.getItem('x');
new VolatileStorage(props?)
props?: object
props.storage?: Storage | async<Storage>
window.localStorage
itself, window.sessionStorage
, or localForage
) where all values will actually be stored.props.maxAge?: number
Infinity
.props.capacity?: number
capacity
value and a new item is added to the storage, the first added item is removed from the storage to maintain the capacity.Infinity
.props.ns?: string
VolatileStorage
sharing the same external storage (like window.localStorage
).''
.props.version?: string | number
window.localStorage
) under a different version.undefined
.The methods of the VolatileStorage
class are asynchronous versions of the Storage
methods.
FAQs
A storage with a customizable item lifetime and capacity with a localStorage-like API
We found that @axtk/volatile-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.