
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Mycache is a cache library enhanced front end local cache. It can provide 4 stores, includes indexedDB, localStorage, sessionStorage and memorayStore.
NPM is the easiest and fastest way to get started using Mycache.
# latest stable
npm install mycache
import Mycache from 'mycache';
const mycache = new Mycache();
Sample example used the promise/async form:
import Mycache from 'mycache';
const mycache = new Mycache();
await mycache.set('key', 'value');
const val = await mycache.get('key');
import Mycache from 'mycache';
const mycache = new Mycache({
name: 'mycache', // name prefix of key
oldItemsCount: 0.2, // this count of old items
stores: ['indexedDB', 'localStorage'], // use first store if system support
});
Mycache API:
// get value of key
function get(key: string): Promise<any> {}
// get all value of keys
function gets() : Promise<any> {}
// set key value and expire time
function set<T>(key: string, value: T, expire: number | Date = -1): Promise<T> {}
// append key value and expire time
function append<T>(key: string, value: T, expire: number | Date = -1): Promise<T> {}
// if the key has in local
function has(key: string): Promise<boolean> {}
// remove key
function remove(key: string): Promise<void> {}
// get all keys
function keys(): Promise<string[]> {}
// clear all keys
function clear(): Promise<void> {}
// the length of all keys
function length(): Promise<number> {}
// each all keys by callback
function each(iterator: (value: any, key: string, iterationNumber: number) => void): Promise<boolean> {}
// if the key is expired
function isExpired(key: string): Promise<boolean> {}
// get all expired keys
function getExpiredKeys(): Promise<string[]> {}
// get all overlength keys
function getOverLengthKeys(): Promise<string[]> {}
// if the key is old
function getOldKeys(): Promise<string[]> {}
// get items by sorted
function getSortedItems(): Promise<typed.IMycacheMetaDataMap[]> {}
[1.0.3] - 2019-01-16
FAQs
A Cache library
The npm package mycache receives a total of 10 weekly downloads. As such, mycache popularity was classified as not popular.
We found that mycache 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.