1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/test/test.js
2023-06-28 11:40:55 -04:00

22 lines
391 B
JavaScript

import { RESP_TYPES, createClient } from '@redis/client';
const client = createClient({
RESP: 3,
commandOptions: {
typeMapping: {
[RESP_TYPES.MAP]: Map
}
}
});
client.on('error', err => console.error(err));
await client.connect();
console.log(
await client.flushAll(),
await client.hSet('key', 'field', 'value'),
await client.hGetAll('key')
)
client.destroy();