redis-pdel

5.0.0 • Public • Published

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).

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i redis-pdel

    Weekly Downloads

    115

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    4.45 kB

    Total Files

    4

    Last publish

    Collaborators

    • perrin4869
    • 20lives