ReDOWN
Work in Progress
A drop-in replacement for LevelDOWN that works with redis. Can be used as a back-end for LevelUP rather than an actual LevelDB store.
Note: the above tests include the use of TypedArray
s. If you don't use them then you can likely ignore the failures.
As of version 0.7, LevelUP allows you to pass a 'db'
option when you create a new instance. This will override the default LevelDOWN store with a LevelDOWN API compatible object. ReDOWN conforms exactly to the LevelDOWN API but only performs operations in memory, so your data is discarded when the process ends or you release a reference to the database.
Example
var ReDOWN = levelup = redis = ; var redis_client = redis; // Either a connection string or an existing redis instance must be passed, or the driver will connect to localhost var db = dbdbdbdb db
Running our example gives:
{ key: 'dob', value: '16 February 1941' }
{ key: 'name', value: 'Yuri Irsenovich Kim' }
{ key: 'occupation', value: 'Clown' }
{ key: 'spouse', value: 'Kim Young-sook' }
Show's over folks!
Licence
Copyright (c) 2013 Andrew Nesbitt. See LICENSE for details.