var level = require('level'); var database = { init: function(){ const db = level('./mydb'); }, open: function(callback){ return this.db.open(callback); }, close: function(callback){ return this.db.close(callback); }, put: function(key, value, options, callback){ return this.db.put(key, value, options, callback); }, get: function(key, options, callback){ return this.db.get(key, options, callback); }, del: function(key, options, callback){ return this.db.del(key, options, callback); }, batch: function(array, options, callback){ return this.db.batch(array, options, callback); }, isOpen: function(){ return this.db.isOpen(); }, isClosed: function(){ return this.db.isClosed(); }, createReadStream: function(options){ return this.db.createReadStream(options); }, createKeyStream: function(options){ return this.db.createKeyStream(options); }, createValueStream: function(options){ return this.db.createValueStream(options); } }; module.exports = database;