-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
46 lines (28 loc) · 953 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
node-tyrant
===========
This is an implementation of the Tokyo Tyrant network protocol for the Node javascript/v8 language.
Update: v0.2
updated to move from promises to function(err, value) callbacks in node.js
Update: v0.1.3
updated to use the updated module structure of node.
Update: v0.1.1
node-tyrant has been updated to use the new binary stream representation, and now uses promises for callbacks.
Install Tokyo Cabinet / Tokyo Tyrant, and set up either a b-tree or table database:
For a table database:
ttserver casket.tdb
For a b-tree (key/value) database:
ttserver casket.tcb
Quick Example
------------
var tyrant = require("./tyrant");
var sys = require('sys');
var c = tyrant.connect();
c.addListener("connect", function (){
c.genuid(function(err, v) {sys.puts(v);});
c.put('0', 'town', 'Bangor € 1');
c.get('0', function(err, values) {
var r=tyrant.dict(values);
sys.puts(r.town);
c.quit();
});
});