1.0.4 • Published 4 years ago

typed-redis-async v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

use redis offical package with bluebird.promisifyAll, and add typescript interface RedisClientAsync,

https://www.npmjs.com/package/redis

Repo

Use

for all cb method add Async to the end

import { RedisClientAsync, createClient } from './RedisClientAsync';

async function test() {
    const client: RedisClientAsync = createClient(6379, 'localhost');

    await client.delAsync('key');
    console.log(await client.getAsync('key'));
    await client.setAsync('key', '1');
    console.log(await client.getAsync('key'));

    console.log(await client.getKeyWithFallback('key', async () => new Date().toDateString() as any));
    console.log(await client.getKeyWithFallback('key', async () => new Date().toDateString() as any));

    process.exit(0);
}

test();
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago