0.1.0 • Published 7 years ago

keyfac v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

keyfac

NPM

npm Build Status Build status Dependency Status devDependency Status

: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