UNPKG

ipfs-api

Version:

A client library for the IPFS HTTP API

21 lines (17 loc) 347 B
'use strict' const pump = require('pump') const concat = require('concat-stream') /* Concatenate a stream to a single value. */ function streamToValue (response, callback) { pump( response, concat((data) => callback(null, data)), (err) => { if (err) { callback(err) } }) } module.exports = streamToValue