feat: Provide promisified method versions
See original GitHub issueAn easy way to do it is to query args length, and then return a promisified version like:
const util = require('util');
return util.promisify(User.get)(options);
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
promisifying an already promisified function with promisifyAll
If the object already has a promisified version of the method, it will be skipped. In fact, the promisifyAll() also creates an Async...
Read more >jcoreio/promisify-child-process: seriously like the best ... - GitHub
promisify -child-process provides a drop-in replacement for the original child_process functions, not just duplicate methods that return a Promise . So when you ......
Read more >The fs module includes promisified methods since Node 11
The fs Node.js module provides promise based methods in a promises property.
Read more >@google-cloud/promisify | Yarn - Package Manager
A simple utility for promisifying functions and classes. A comprehensive list of changes in each version may be found in the CHANGELOG. Google...
Read more >Promisification - The Modern JavaScript Tutorial
It calls it providing its own callback that translates to promise resolve/reject . Now loadScriptPromise fits well in promise-based code. If we ...
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 FreeTop 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
Top GitHub Comments
@fishcharlie
1- OK, I will take that into account for the next issue, this seemed so easy for me to be explained that I thought filling the whole template was too much for two lines of explanation.
Nevertheless, it could be great if you educate us instead of trigger a defensive action by just closing it, since if I took the time to fill an issue at least is a sign that I want the project to be better.
2- Nice! It could be good if that is added to the documentation, since all examples have the callback pattern and there is no immediate clue that Promisified versions are available.
(all have it but populate, which is a special case and I thought that was only for it).
@diosney
Not filling out ALL of the relevant fields in this issue will cause your issue to be closed
.util.promisify
isn’t required.