Help with a function in node.js
€8-30 EUR
Paiement à la livraison
Hi need help to make a function async in node.js
[login to view URL]
in the function i need to get x = response body before return
Right now it just returns ""
Nº du projet : #11590079
À propos du projet
20 freelances font une offre moyenne de 24 € pour ce travail
You need to understand nature of javascript which is asynchronous that means your return statement do not wait to complete the request made by unirest, You should either use callback function or promise.
Hey there! :) As your code's written right now, it's definitely going to be returning x before it has the chance to set it. The easiest way to fix this would be with either callbacks or promises; I would probably re Plus
Hi, I have solved your problem. It's working now. I am able to get the results in the result array. Ping me back so that I can show you a demo. Thanks.
In node you should get used to passing things to callbacks instead of running things async. I can show you how to do it. You can also use ES6 generators if you want it to wait for a value, or promises.
Hello. I know, how to fix the error. I even already did it. If you choose me, I will explain what the problem is. What Node.js version are you using? For now, I work more for feedback, rather than money. You Plus
I have been working in the nodeJS for last 2 years. I have written a lot of APIs using async package which is very similar to your requirement. If i get this project this will be my first project that why i am bidding Plus
Hello. Need to write asyncronous code in order to complete such tasks. Will do it in several minutes.
Hi there, I have gone through your job-posting and become very eager to work with you. I am a hard worker and very punctual. My main goal is to gain my client's satisfaction by completing the job with 100% accurac Plus
I could do it with making your request synchronous But in general you should use callbacks and promise objects to return data from async call. Good luck!
I have a lot of experience in asynchronous programming in Node.js. I understand the problem, I've solved similar issues before in my own work.