0.5.1 • Published 1 year ago

redis-type v0.5.1

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

redis-type - redis type wrapper

This small library gives you Promises and (!) JS-like wrappers for Redis types.

Redis HASH -> JS Map    // have you ever thought they are so similar?
Redis LIST -> JS Array  // this one is a bit obvious
Redis SET  -> JS Set    // and this one even more!

Install and use

As all the npm packages, this one is installed like this:

$ npm install --save redis-type

To use this library, you have to include redis-type in your JS code and initialize it with Redis client.

// The first one
const redis  = require('redis');
const client = redis.createClient();

// Initialize library with a client (!)
const { Hash, List, Set }  = require('redis-type').bind(client);

const users  = Hash('users', true); // second argument is for JSON processing

(async () => {
    await client.connect();

    const allUsers = await users.getAll();

    await users.set('sam', { name: 'Sam', age: '19' });

    const sam = await users.get('sam');

})();
0.5.0

1 year ago

0.5.1

1 year ago

0.3.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago