question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: Provide promisified method versions

See original GitHub issue

An 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:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
diosneycommented, Apr 11, 2019

@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).

1reaction
fishcharliecommented, Apr 10, 2019

@diosney

  1. The issue template was not filled out for this issue which is a strong requirement of filing issues for Dynamoose. At the very top of the issue template it says Not filling out ALL of the relevant fields in this issue will cause your issue to be closed.
  2. This is already implemented into Dynamoose. If you don’t pass in a callback into a method, Dynamoose will return a promise. Using util.promisify isn’t required.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found