Skip to content

barnuri/redis-client-async-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •