# node-redis-streamify

> A Node.js library to augment node_redis interface with streaming version of commands SCAN, HSCAN, SSCAN, ZSCAN.

Latest version **0.1.6** (published 2016-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-redis-streamify
pnpm add node-redis-streamify
yarn add node-redis-streamify
bun add node-redis-streamify
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2016-06-06 |
| First published | 2014-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Adriano Di Giovanni |
| Maintainers | adriano.digiovanni |
| Keywords | node, redis, stream, readable, scan, hscan, sscan, zscan |

## Links

- npm: https://www.npmjs.com/package/node-redis-streamify
- Repository: https://github.com/adriano-di-giovanni/node-redis-streamify
- Issues: https://github.com/adriano-di-giovanni/node-redis-streamify/issues
- npm.io page: https://npm.io/package/node-redis-streamify

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ~1.7.0

## 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

- 0.1.6 (latest) — 2016-06-06
- 0.1.5 — 2015-04-10
- 0.1.4 — 2015-04-10
- 0.1.3 — 2015-04-09
- 0.1.2 — 2014-12-13
- 0.1.0 — 2014-12-13

## README

# node-redis-streamify

A Node.js library to augment [node_redis](https://github.com/mranney/node_redis) interface with streaming version of commands SCAN, HSCAN, SSCAN, ZSCAN.

## Installation

```
npm install node-redis-streamify --save
```

## Usage

```javascript
var
	redis = require('redis');

require('node-redis-streamify')(redis);

var
	scan = redis.streamified('SCAN'); // case insensitive

scan('*')
	.on('data', function (data) {
		// your code here
		// call this.end() if you want to stop scanning
	})
	.on('error', function (error) {
		// your code here
	})
	.on('end', function () {
		// your code here
	});
```

## Supported commands

* [SCAN](http://redis.io/commands/SCAN)
* [HSCAN](http://redis.io/commands/HSCAN)
* [SSCAN](http://redis.io/commands/SSCAN)
* [ZSCAN](http://redis.io/commands/SCAN)

## Streamified API

### SCAN

```javascript
var
	pattern = '*',
	count = 10,
	scan = redis.streamified('SCAN'); // case insensitive

scan(pattern, count)
	.on('data', function (data) {})
	.on('error', function (error) {})
	.on('end', function () {});
```

### HSCAN

```javascript
var
	key = 'path:to:key'
	pattern = '*',
	count = 10,
	hscan = redis.streamified('HSCAN'); // case insensitive

hscan(key, pattern, count)
	.on('data', function (data) {})
	.on('error', function (error) {})
	.on('end', function () {});
```

### SSCAN

```javascript
var
	key = 'path:to:key'
	pattern = '*',
	count = 10,
	sscan = redis.streamified('SSCAN'); // case insensitive

sscan(key, pattern, count)
	.on('data', function (data) {})
	.on('error', function (error) {})
	.on('end', function () {});
```

### ZSCAN

```javascript
var
	key = 'path:to:key'
	pattern = '*',
	count = 10,
	zscan = redis.streamified('ZSCAN'); // case insensitive

zscan(key, pattern, count)
	.on('data', function (data) {})
	.on('error', function (error) {})
	.on('end', function () {});
```

## Alternatives

These are a few alternative projects:

* [redis-scanstreams](https://github.com/brycebaril/redis-scanstreams)

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