Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipfs-api

Package Overview
Dependencies
Maintainers
5
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-api - npm Package Compare versions

Comparing version 2.6.1 to 2.6.2

2

package.json
{
"name": "ipfs-api",
"version": "2.6.1",
"version": "2.6.2",
"description": "A client library for the IPFS API",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -5,2 +5,3 @@ 'use strict'

const getFilesStream = require('./get-files-stream')
const stream = require('stream')

@@ -11,3 +12,3 @@ const isNode = !global.window

function onEnd (buffer, result, cb) {
function onEnd (buffer, result, passThrough, cb) {
return (err, res, body) => {

@@ -22,2 +23,9 @@ if (err) {

if (result.stream) {
cb(null, passThrough)
passThrough.resume()
passThrough.end()
return
}
if ((result.stream && !buffer) ||

@@ -39,4 +47,8 @@ (result.chunkedObjects && buffer)) {

function onData (result) {
function onData (result, passThrough) {
return chunk => {
if (result.stream) {
passThrough.write(chunk)
return
}
if (!result.chunkedObjects) return

@@ -70,4 +82,6 @@

return request(opts, onEnd(buffer, result, cb))
.on('data', onData(result))
var passThrough = new stream.PassThrough()
return request(opts, onEnd(buffer, result, passThrough, cb))
.on('data', onData(result, passThrough))
.on('response', onResponse(result))

@@ -74,0 +88,0 @@ }

@@ -155,3 +155,5 @@ /* global describe it before */

apiClients['a'].cat('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP', function (err, res) {
if (err) throw err
if (err) {
throw err
}

@@ -158,0 +160,0 @@ if (typeof res === 'string') {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc