5.0.1 • Published 9 days ago

redis-pdel v5.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
9 days ago

redis-pdel

Build Status npm package

pdel lua command for redis clients

pdel redis command

Deletes all the keys matching a specific regex, for example

set foo:one val
set foo:two val
pdel foo:*
get foo:one <- nil
get foo:two <- nil

Note: this is not meant to be used in production. Supports Node 4+.

Install

$ npm install --save redis-pdel

Usage

The easiest usecase is to use with https://github.com/luin/ioredis as follows:

import Redis from 'ioredis';
import { name, lua, numberOfKeys } from 'redis-pdel';

const redis = new Redis();
redis.defineCommand(name, { lua, numberOfKeys });

Then, just run like any other command:

redis.pdel('foo:*');

Tests

There are unit tests and integration tests. The integration tests require redis to be running.

docker-compose up
npm test:unit
npm test:integration
npm test # run both tests

License

See the LICENSE file for license rights and limitations (MIT).

5.0.1

9 days ago

5.0.0

16 days ago

4.0.1

1 year ago

4.0.0

2 years ago

3.0.0

3 years ago

2.0.0

4 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago