ssdb-node
v5.1.0
Published
ssdb nodejs client library, ssdb is a fast nosql database, an alternative to redis.
Downloads
23
Readme
SSDB NodeJS 客户端
- 基于https://github.com/eleme/node-ssdb 改写;
- 主要是修复了上述客户端的请求和应答对应错误的问题;
- 添加自动重连机制,可通过autoReconnect关闭;
npm install ssdb-node --save
Example
'use strict';
const co = require('co');
const ssdb = require("./lib/client");
const options = {
host: '127.0.0.1',
port: 8888,
promisify: true,
size: 3,
logger: undefined,
autoReconnect: true
};
let client = new ssdb(options);
function* main() {
console.info(yield Promise.all([
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key2"),
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key2"),
client.hget("test-ssdb-client", "key1"),
client.hget("test-ssdb-client", "key1")
]).catch(function (error) {
console.error(error)
}));
}
co(main());