code: function promisify(callback: Function, throwError: boolean = true): Function {
    return function promisified(...parameters) {
      let promise = new Promise((resolve, reject) => {
        parameters.push(function(error, data) {
          if (error) {
            reject(error)
          } else resolve(data)
        })
        callback.apply(this, parameters)
      })
      if (!throwError) {
        promise = promise.then(function(result) {
          return typeof result === 'undefined' ? true : result
        }).catch(function() {
          return false
        })
      }
      return promise
    }
  }
docs: /* @flow