keyfac

0.1.0 • Public • Published

keyfac

NPM

npm Build Status Build status Dependency Status devDependency Status

🔑 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

/keyfac/

    Package Sidebar

    Install

    npm i keyfac

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • pine613