
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
local-data-storage
Advanced tools
It's a simple wrapper over browsers native localStorage. It uses "smart" items and can work with existing localStorage entries. It always returns success of operation as boolean.
$ npm install local-data-storage
| Name | Parameters | Description | Return value |
|---|---|---|---|
isAvailable() | It tests if localStorage is available | boolean | |
itemExists() | key: string | It check existence of an item | boolean |
clearExpiredItems() | Clears expired items | boolean | |
getItem() | key: string | Return an item by key | *LocalDataStorageItem |
setItem() | key: string, obj: *LocalDataStorageItem, forceOverwrite?: boolean | Saves an item with given key | boolean |
removeItem() | key: string | Removes an item by key | boolean |
clear() | Clears the whole storage | boolean |
import {
isAvailable,
itemExists,
clearExpiredItems,
getItem,
setItem,
removeItem,
clear,
} from "local-data-storage";
if (isAvailable()) {
/* do something */
}
if (itemExists("cat")) {
/* do something */
}
clearExpiredItems();
const myItem = getItem("cat");
setItem("cat", { value: "meow" });
setItem("willExpireCat", { value: "meow", expiryDate: Date.now() + 86_400 });
setItem("cat", { value: "OVERWRITTEN" }, true);
removeItem("cat");
clear();
| Property | Type | Description |
|---|---|---|
| value | string | This will always exist, will contain unparseable items from storage as well. |
| createdDate | number | This is a timestamp of creation. It will be set automatically at saving. |
| expiryDate | number | This is an optional property. It's a timestamp of expiry, will be deleted by clearExpiredItems() if expired. |
{
value: 'cat',
createdDate: 86400,
expiryDate: 86401
}
FAQs
Just another LocalStorage wrapper.
We found that local-data-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.