cache-key-format
v1.1.5
Published
format cache key for redis
Downloads
3
Readme
cache-key-format
- Support generate cache key with object
const formated = require('cache-key-format');
const key = formated('video', {
country: 'VN',
age: 7,
platform: 'ios'
});
// video:age_7:country_VN:platform_ios
const formated = require('cache-key-format');
const opts = {
separateKeyValue: '-',
separateFolder: '::',
lowerCase: true
};
const key = formated('video', {
country: 'VN',
age: 7,
platform: 'ios'
}, opts);
// video::age-7::country-vn::platform-ios
- Default options:
const defaultOpts = {
separateKeyValue: '_',
separateFolder: ':',
lowerCase: false
}