Database module for node.js
I've found a way, it's not the best though. You can use nimble (Or async, it's basically the same but both larger in size and contain more functions) to do a series of functions, and then check from within the helper-class to see if a certain value has been set.

This is my new and improved version of the run-function:

db.prototype.run = function(callback){
    var self = JSON.parse(JSON.stringify(this));
    for(var key in this){
        if(typeof this[key] != "functions" &amp;&amp; key != "dir" &amp;&amp; key != "table") delete this[key];
    }
    helper.mkdb(self, function(err, created){
        helper.mktbl(self, function(err, created){          
            self.docs = [];
            nimble.series([
                function(done){
                    if(!self.put) done(err, []);
                    else{
                        helper.put(self, function(err, docs){
                            self.docs = docs;
                            done(err, docs);
                        })
                    }
                },
                function(done){
                    if(!self.query &amp;&amp; !self.find) done(err, self.docs || []);
                    else{
                        helper.find(self, function(err, docs){
                            self.docs = docs;
                            done(err, docs);
                        })
                    }
                },
                function(done){
                    if(!self.pluck) done(err, self.docs || []);
                    else{
                        helper.pluck(self, function(err, docs){
                            self.docs = docs;
                            done(err, docs);
                        })
                    }
                }
            ], function(err, res){
                callback(err, helper.lastData(res));
            })
        })
    });
}