shade

a file system data store using SHA1 keys

shade

A file system data store using SHA1 keys

var shade = require('shade');
 
shade('/tmp/mydata', function (errdb) {
    db.save('ChBZvReWjm5YcTXTMK1GZausXZaCn', function (errkey) {
        console.log(key) // ecef0937 
    })
});
 
var shade = require('shade');
 
shade('/tmp/mydata', function (errdb) {
    db.load('ecef0937', function (errdata) {
        if (!err) {
            console.log(data); // ChBZvReWjm5YcTXTMK1GZausXZaCn 
        }
    })
});
 

Creates a new data store rooted in the specified directory. cb(err, db) is called with either an error or a handle to the data store.

Saves a string s into the data store. cb(err, key) is called with either an error or the 8-character key that can be used to retrieve the data from the load method.

Loads a string from the data store using the specified key. cb(err, data) is called with either an error or the previously saved string.

Using npm:

npm install shade

MIT