Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mycache

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycache

A Cache library

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by166.67%
Maintainers
1
Weekly downloads
 
Created
Source

Mycache

Build Status NPM version Dependency Status npm

Mycache is a cache library enhanced front end local cache. Mycache provides two kinds of cache: persist cache and memory cache. Persist cache uses localforage to support.

npm install mycache

How to use Mycache

Init cache

import { Cache, Persist } from 'mycache';

const persist = new Persist();

And the Promise/Async form:

import { Cache, Persist } from 'mycache';

const persist = new Persist();

async function persist() {
  await persist.set('key', 'value');
  return await persist.get('key');
}

Configuration

Cache Config:

import { Cache } from 'mycache';

const cache = new Cache({
  name: 'mycache', // name prefix of key
});

Persist Config:

import { Persist } from 'mycache';

const persist = new Persist({
  name: 'mycache', // name prefix of key
  valueMaxLength: 500 * 1000, // max length of value
  storeName: 'persist'; // The name of the datastore
});

Keywords

FAQs

Package last updated on 17 Apr 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc