keyfac
v0.1.0
Published
Declare cache key generator
Downloads
1
Readme
keyfac
:key: Declare cache key generator inspired by Cache::Keys::DSL.
Requirements
- Node v4 or later
Getting started
$ yarn add keyfac
or
$ npm install --save keyfac
Usage
const { key, keygen } = requure('keyfac')
// Simple key
const userCountKey = key('user_count')
console.log(userCountKey) // => key_for_user_count
// Key with User ID
const userNameKey = keygen('user_name')
console.log(userNameKey(1)) // => gen_key_for_user_name_1
See also test.js.
References
key(... items)
Create simple key.
keygen(... items)
Create key generator function with base arguments.
License
MIT © Pine Mizune