KyotoTycoon client for Node.js
npm install kt-client
const KyotoTycoon = require('kt-client');
const kt = new KyotoTycoon(options);
host
: String KyotoTycoon serverport
: Number port number
key
: String the name of the keyoptions
: Object optionscallback
: Function the callback
kt.get('foo', (error, value) => {
console.log(value);
});
key
: String the name of the keyvalue
: Mixed valueoptions
: Object optionscallback
: Function the callback
kt.set('foo', 'bar', (error) => {
console.log(error);
});
key
: String the name of the keyvalue
: Mixed valueoptions
: Object optionscallback
: Function the callback
kt.add('foo', 'bar', (error) => {
console.log(error);
});
key
: String the name of the keyvalue
: Mixed valueoptions
: Object optionscallback
: Function the callback
kt.replace('foo', 'bar', (error) => {
console.log(error);
});
key
: String the name of the keycallback
: Function the callback
kt.remove('foo', (error) => {
console.log(error);
});
callback
: Function the callback
kt.void((error) => {
console.log(error);
});
params
: Object arbitrary recordscallback
: Function the callback
kt.echo({foo: 'bar'}, (error, data) => {
console.log(data.foo); // => bar
});
callback
: Function the callback
kt.report((error, data) => {
Object.keys(data).forEach((key) => {
console.log(`key: ${key}, value: ${data[key]}`);
});
});
options
: Object optionscallback
: Function the callback
kt.status((error, data) => {
Object.keys(data).forEach((key) => {
console.log(`key: ${key}, value: ${data[key]}`);
});
});
options
: Object optionscallback
: Function the callback
kt.clear((error) => {
console.log(error);
});
key
: String the name of the keyvalue
: Mixed valueoptions
: Object optionscallback
: Function the callback
kt.append(key, value, (error) => {
console.log(error);
});
key
: String the name of the keynum
: Number the additional numberoptions
: Object optionscallback
: Function the callback
kt.increment(key, num, (error, num) => {
console.log(num);
});
key
: String the name of the keynum
: Number the additional numberoptions
: Object optionscallback
: Function the callback
kt.incrementDouble(key, num, (error, num) => {
console.log(num);
});
key
: String the name of the keyoldValue
: Mixed the old valuenewValue
: Mixed the new valueoptions
: Object optionscallback
: Function the callback
kt.cas(key, oldValue, newValue, (error) => {
console.log(err);
});
key
: String the name of the keyoptions
: Object optionscallback
: Function the callback
kt.check(key, (error, size, expire) => {
console.log(size);
console.log(expire);
});
key
: String the name of the keyoptions
: Object optionscallback
: Function the callback
kt.seize(key, (error, value, expire) => {
console.log(value);
console.log(expire);
});
records
: Object the recordsoptions
: Object optionscallback
: Function the callback
kt.setBulk(records, (error) => {
console.log(error);
});
keys
: Array the key of the recordoptions
: Object optionscallback
: Function the callback
kt.removeBulk(keys, (error) => {
console.log(error);
});
keys
: Array the key of the recordoptions
: Object optionscallback
: Function the callback
kt.getBulk(keys, (error, ret) => {
console.log(ret.key);
});
options
: Object optionscallback
: Function the callback
kt.vacuum((error) => {
console.log(error);
});
prefix
: String the prefix stringoptions
: Object optionscallback
: Function the callback
kt.matchPrefix('foo', (error, data) => {
data.forEach((v) => {
console.log(v);
});
});
regex
: String the regular expression stringoptions
: Object optionscallback
: Function the callback
kt.matchRegex('foo.*', (error, data) => {
data.forEach((v) => {
console.log(v);
});
});
origin
: String the origin stringoptions
: Object optionscallback
: Function the callback
kt.matchSimilar('foo', (error, data) => {
data.forEach((v) => {
console.log(v);
});
});