code: function wrap_cb(fn, P) {
    return function (params) {
      return new P(function (resolve, reject) {
        fn(params, function (err) { return !err ? resolve() : reject(err); });
      });
    };
  }
docs: Wrap handler with callback