redis-key
Redis key generator / function argument joiner
This module is basically a shortcut for:
Array.prototype.slice.call(arguments).join(separator);
install
npm install redis-key
example
var rk = require('redis-key');
var key = rk('product-collection', 'company', 'price-level');
Setting a default separator
var rk = require('redis-key').defaults('/');
var key = rk('part', 1, 3);
motivation
I've been generating redis keys like this:
var key = ['part1', var1, var2, var3].join(':');
I thought it would be more concise to be able to do this:
var key = k('part1', var1, var2, var3);
And if my math is correct, it is more concise by 9 whole characters. Joy.
license
MIT