Socket
Book a DemoInstallSign in
Socket

wecache

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wecache

cache for wechat mini program

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

wecache Build Status

local cache library for wechat mini program (using storage) 微信小程序缓存库(使用storage)

Install

$ npm i -S wecache

Usage

const wecache = require('wecache')

wecache.set('foo', 'bar')
wecache.get('foo')  // bar

Api

.set(key, value, [expire])

Add an item to the cache

key

Type: number or string(except "")

value

Type: any

expire

Type: number(milliseconds from now to expire) or date(the expire date). if set a number, number should not greater than 1000 * 24 * 3600 * 1000(milliseconds of one thousands days)

Default: 1 * 24 * 3600 * 1000(milliseconds of one day)

.get(key)

Retrieve item from the storage

key

Type: number or string(except "")

.incr(key)

Increment item's value

key

Type: number or string(except "")

.decr(key)

Decrement item's value

key

Type: number or string(except "")

.remove(key)

Delete item from the storage

key

Type: number or string(except "")

.clear()

Delete all existing items from the storage

.all()

Get all caches

License

MIT © klouskingsley

Keywords

cache

FAQs

Package last updated on 12 Jul 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