redis-key
Redis key generator / function argument joiner
This module is basically a shortcut for:
Arrayprototypeslice;
install
npm install redis-key
example
var rk = ; //default separator is ':'var key = ;//key = "product-collection:company:price-level"
Setting a default separator
var rk = ; //now the separator is '/'var key = ;//key = "part/1/3"
api
.defaults([separator, [prefix]])
- separator - [string] the character[s] to put between the tokens that make up your key (default ':')
- prefix - [string] an additional token that is prefixed to the key
motivation
I've been generating redis keys like this:
var key = 'part1' var1 var2 var3;
I thought it would be more concise to be able to do this:
var key = ;
And if my math is correct, it is more concise by 9 whole characters. Joy.
license
MIT