Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
flexible-storage
Advanced tools
Module for front-end storage using LocalStorage (or any another Storage).
It introduces some features:
Using NPM:
npm i --save flexible-cache
You can use default import to use FlexibleStorage with Local
import { FlexibleStorage } from "flexible-cache";
// Using Session Storage and some string prefix
const sessionFlexibleStorage = new FlexibleStorage(
window.sessionStorage,
'some_prefix_' // this prefix will be used internally when working with storage
);
// Using Local Storage and function prefix
const prefix = (key) => "<key>" + key + "</key>";
const FlexibleStorage = new FlexibleStorage(window.localStorage, prefix);
Note: prefix may be skipped
import { FlexibleStorage } from "flexible-cache";
const expires = new Date(); // also can be Moment.js instance
const flexibleStorage = new FlexibleStorage(localStorage);
flexibleStorage.push('key', {
someProperty: 2,
}, expires);
import { FlexibleStorage }, { arrayOrEmptyArray } from "flexible-cache";
const flexibleStorage = new FlexibleStorage(localStorage);
// Value will be stored array or empty array if nothing stored
let value = flexibleStorage.pull('key', arrayOrEmptyArray);
// Just to pull value with validating only key expiring
value = flexibleStorage.pull('key');
Find more validators here
import { FlexibleStorage } from "flexible-cache";
const flexibleStorage = new FlexibleStorage(localStorage, 'prefix_');
flexibleStorage.exists('key'); // will try to find and validate `prefix_key` in LocalStorage
flexibleStorage.remove('key'); // will remove `prefix_key` from LocalStorage
npm test
FAQs
Cache on frontend using LocalStorage
The npm package flexible-storage receives a total of 11 weekly downloads. As such, flexible-storage popularity was classified as not popular.
We found that flexible-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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.