/*  TTL cache:
 *
 */
var cache = {
  memory: {}
}

/*  Save to cache:
 *
 *  @param  identifier  {string}
 *  @param  data        {string}
 *  @param  callback    {function}
 */
cache.write = function (identifier, data, ttl, callback) {
  this.memory[identifier] = data;
  
  if (ttl) setTimeout(function () {
    delete this.memory[identifier]
  }.bind(this), ttl);
  
  if (callback) callback()
}

/*  Read from cache:
 *
 *  @param  identifier  {string}
 *  @param  callback    {function}
 */
cache.read = function (identifier, callback) {
  return this.memory[identifier];
  
  if (callback) callback()
}

/*  Delete from cache:
 *
 *  @param  identifier  {string}
 *  @param  callback    {function}
 */
cache.delete = function (identifier, callback) {
  delete this.memory[identifier]
  
  if (callback) callback()
}

/*  Destroy cache:
 *
 *  @param  callback  {function}
 */
cache.destroy = function (callback) {
  this.memory = {};
  
  if (callback) callback(null, {
    error: false,
    success: true,
    message: 'Cache now empty'
  })
}

module.exports = cache
@@ -543,15 +543,31 @@
 %7B%0A  
-return 
+if (callback) callback(
 this
@@ -589,39 +589,49 @@
 ier%5D
+)
 ;%0A  
-%0A  if (callback) callback()
+else return this.memory%5Bidentifier%5D;
 %0A%7D%0A%0A

Read cache callback