
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
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 17 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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.