first commit
This commit is contained in:
15
utils/keyv.js
Normal file
15
utils/keyv.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Keyv from 'keyv'
|
||||
|
||||
const cacheOptions = {
|
||||
namespace: 'settings',
|
||||
uri: 'sqlite://database.sqlite',
|
||||
}
|
||||
const cache = new Keyv(cacheOptions);
|
||||
|
||||
export const getSetting = async (key) => {
|
||||
return await cache.get(key)
|
||||
}
|
||||
|
||||
export const setSetting = async (key, value) => {
|
||||
return await cache.set(key, value)
|
||||
}
|
||||
Reference in New Issue
Block a user