How to complete async waterfall?

Good afternoon. I'm using the async module node.js
The question arose how to complete the async waterfall.
The logic is as follows: to request the cache if the cache is - to give the right answer, if there is no cache - to make a request to api
So if the cache is - I would like to conclude from waterfall. You can traverse the object cache, the first parameter in the callback as an error, but it is somehow ugly and it might not be obvious to others. Are there any other options?
July 2nd 19 at 13:43
3 answers
July 2nd 19 at 13:45
Wouldn't it be easier to make promises?
cache.get(key).then((data) => {
 if (data) return data;

 return api.something;
July 2nd 19 at 13:47
As to whether there need waterfall? Obtaining a cache is a blocking operation? If Yes, then you can wrap it in the normal promis. According to your description, I think that can be done without the waterfall
waterfall is urgent need for serial trigger functions with blocking operations and the possibility of transfer of arguments from one to the next...
July 2nd 19 at 13:49
async waterfall, if I'm not mistaken, doesn't a dynamic flow. And you just the algorithm with the condition. Use promises.

Find more questions by tags JavaScriptNode.js