Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
IPFS .cat() method doesn’t return the content

I work with JavaScript and Browserify tool in Windows 10. With Browserify, One can require NodeJS modules on browser side. I required ipfs module for my JavaScript code in a .js file then browserfied that. In my application, IPFS gets the content and adds it with .add() method in browser side. After that, It gives me the related CID. I try to get the main content from server side via NodeJS. So, I try .cat() method on a .js file and run NodeJS by PowerShell. Problem is here. By this way, No content returned to me. I don’t know why.

The JavaScript code that browserified by Browserify:

const IPFS=require(“ipfs”);
.
.
.
const peer=await IPFS.create({host:“localhost”,port:5001,protocol:“http”});
peer.add().then(function(data){
window.alert(data.path)";
});

I copied the alerted result and pasted that on .cat() method that is below:

async function getFromIPFS(){
    const peer=await IPFS.create({host:“localhost”,port:5001,protocol:“http”});
    const flow=peer.cat();
    let mainContent="";
    for await(const chunk of flow){
    mainContent+=chunk.toString();
    }
    console.log(mainContent);
}

This function called in NodeJS. When I run the NodeJS, The below result emerges on PowerShell:

enter image description here

As you can see, No content returned. What is the problem? How can fix it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!