Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Node is your mansion, Alfred is your butler. Node.js key-value store
JavaScript
tree: 29a7548186

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
benchmarks
dist/bplustree
docs/web
lib/alfred
test
tools
.npmignore
LICENSE
Makefile
README.markdown
TODO
index.js
package.json

README.markdown

Alfred is a fast in-process key-value store for node.js.

Alfred supports:

  • multiple key-value maps in one database
  • atomic operations on one record
  • finder streams
  • activity streams
  • append-only files
  • compactation
  • buffered and unbuffered writes
  • in-memory indexes
  • sorting
  • replication
  • integrity check

More...

Install via npm:

$ npm install alfred

Example:

var Alfred = require('alfred');
// Open database
Alfred.open('path/to/db', function(err, db) {
  if (err) { throw err; }

  // define User model and its properties
  var User = db.define('User', {
    indexes: [{name: 'age',
              fn: function(user) { return user.age; }]
  });
  User.property('name', 'string', {
    maxLength: 100
  });
  User.property('active', 'boolean');

  // get user by id
  User.get(id, function(user) {
    console.log(user.inspect());
  };

  // find users
  User.find({age: {$gt: 18}}).all(function(users) {
    console.log('Found ' + users.length + ' users with more than 18 years') ;
  });
});

Read more about it

Something went wrong with that request. Please try again.