npm.io
0.1.3 • Published 4 years ago

@void-cache/indexdb

Licence
MIT
Version
0.1.3
Deps
2
Size
5 kB
Vulns
0
Weekly
0

@void-cache/indexdb

npm (scoped)

void-cache 的indexDB 实现

国内用户可访问国内镜像

直接使用

Demo

import {indexDBCache} from '@void-cache/indexdb'

await indexDBCache.get('foo')
await indexDBCache.set('foo', 'bar')
await indexDBCache.has('foo')
await indexDBCache.clear()
await indexDBCache.remove('foo')

创建一个新实例使用

Demo
import {createIndexDBCache} from '@void-cache/indexdb'

export const store = createIndexDBCache({
  dbName: 'void-cache',
  storeName: 'void-cache',
})

await store.get('foo')
await store.set('foo', 'bar')
await store.has('foo')
await store.clear()
await store.remove('foo')