promisification
See original GitHub issueI notice that in IncomingForm.parse()
, the callback function is not returned, simply run. this makes promisification impossible, as far as I know. Is there a reason why the callbacks are not returned?
Right now I would like to get a return value out of the parse()
, since the callback does fit the standard node callback format (function(err, [args...])
). I need to use the result of the parse in another module which I cannot modify…
If changing the code to be return cb(err, fields, files)
is not a possibility, is there a way to mimic a return value?
thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
JavaScript Promisification - W3docs
Promisification is a long term for a straightforward transformation. It represents a conversion of the function, which accepts a callback into a function ......
Read more >Promisification - Bluebird JS
Promisification means converting an existing promise-unaware API to a promise-returning API. The usual way to use promises in node is to Promise.promisifyAll ...
Read more >How to Write Your Own Promisify Function from Scratch
Promisification means transformation. It's a conversion of a function that accepts a callback into a function returning a promise. Using Node.
Read more >Promisification in JavaScript: How to and When is It Safe?
The best and easiest way is to use an already implemented method for turning a function that accepts a callback into a promise....
Read more >Promise, Promisification, Promisify Function - Techfastly
Promise is definitely a good approach when it comes to async/await. Even so, it cannot completely replace callback. Promise has only one ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can’t return from callbacks which is normal. If you want you can create promise wrapper for formidable if there’s no one already.
Something like
It looks resolved 😃