mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-07 04:50:54 +08:00
14 lines
289 B
TypeScript
14 lines
289 B
TypeScript
import { Reader, Config, createConnection } from "hiredis";
|
|
|
|
const socket = createConnection(6379, "localhost");
|
|
|
|
socket.write("INFO");
|
|
|
|
const reader = new Reader({ return_buffers: false });
|
|
|
|
// Data comes in
|
|
reader.feed("$5\r\nhello\r\n");
|
|
|
|
// Reply comes out
|
|
reader.get(); // => "hello"
|