Skip to content

toomeefed/maybe-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maybe-store

也许是你想要的 K/V 缓存模块

Travis Coverage Status David npm (scoped) node (scoped) GitHub license

PS: 借(抄)鉴(袭) keyv

一个简单的 key/value 存储适配器,支持扩展任意数据库。支持 ttl 有效期参数,合适作为缓存使用。

安装

$ yarn add @toomee/maybe-store # 推荐
# 或者
$ npm i -S @toomee/maybe-store

使用

const MaybeStore = require('@toomee/maybe-store');

const store = new MaybeStore();

await store.set('foo', 'expires in 1 second', 1000); // true
await store.set('foo', 'never expires'); // true
await store.get('foo'); // 'never expires'
await store.delete('foo'); // true
await store.clear(); // undefined

License

MIT

About

a simple K/V storage module for nodejs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages