node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Toji is Kyoto Cabinet bindings for Node.js with an Avro mapper.


Toji depends on Kyoto Cabinet. Use a package manager or build from source.

sudo pacman -S kyotocabinet      ## Arch Linux
sudo port install kyotocabinet   ## Mac Ports
sudo brew install kyoto-cabinet  ## Homebrew

Then, install with npm:

npm install Toji

Project Structure

Toji uses Kyoto Cabinet to store documents. Bindings are implemented in src/ and wrapped lightly with Javascript in lib/kyoto.js.

Documents are stored in an Avro format. A partial Avro implementation can be found in lib/avro. Most Avro details are hidden by models (lib/models.js). Models allow schema to be defined by declaring Javascript types and manage serialization details.

Documents storage is managed by lib/storage.js. The storage layer exposes a query interface (lib/query.js) for retrieving documents and uses model validation (lib/validation.js) to check data integrity before saving it.

Future Work

  • Indexes
  • Query optimizer
  • Replication
  • Binary Avro encoding
  • Complete Avro schema support