# redis-key

> Redis key generator / function argument joiner

Latest version **1.3.0** (published 2015-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-key
pnpm add redis-key
yarn add redis-key
bun add redis-key
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2015-11-23 |
| First published | 2015-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dan VerWeire |
| Maintainers | wankdanker |
| Keywords | redis, key, join, arguments |

## Links

- npm: https://www.npmjs.com/package/redis-key
- Repository: https://github.com/wankdanker/node-redis-key
- Homepage: https://github.com/wankdanker/node-redis-key#readme
- Issues: https://github.com/wankdanker/node-redis-key/issues
- npm.io page: https://npm.io/package/redis-key

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2015-11-23
- 1.2.0 — 2015-10-14
- 1.1.0 — 2015-10-14
- 1.0.0 — 2015-10-14

## README

redis-key
---------

Redis key generator / function argument joiner

This module is basically a shortcut for:

```js
Array.prototype.slice.call(arguments).join(separator);
```

install
-------

```bash
npm install redis-key
```

example
-------

```js
var rk = require('redis-key');

//default separator is ':'
var key = rk('product-collection', 'company', 'price-level');
//key = "product-collection:company:price-level"
```

### Setting a default separator

```js
var rk = require('redis-key').defaults('/');

//now the separator is '/'
var key = rk('part', 1, 3);
//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:

```js
var key = ['part1', var1, var2, var3].join(':');
```

I thought it would be more concise to be able to do this:

```js
var key = k('part1', var1, var2, var3);
```

And if my math is correct, it is more concise by 9 whole characters. Joy.

license
-------

MIT

---
_Source: https://npm.io/package/redis-key · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
