UNPKG

271 BJavaScriptView Raw
1'use strict'
2
3module.exports = function (request) {
4 return new Promise((resolve, reject) => {
5 const buffer = []
6 request
7 .on('data', chunk => buffer.push(chunk.toString()))
8 .on('error', reject)
9 .on('end', () => resolve(buffer.join('')))
10 })
11}