bluebird Questions

3

I have a nodejs / typescript 2 project and use the es6-promise package. Now i would like to get rid of the extra package because i can target ES6 in typescript directly. So i removed the es6-pro...
Improvident asked 9/3, 2017 at 7:57

9

I would like to wait for a map of word to Promise to finish. BlueBird has Promise.props which accomplishes this, but is there a clean way to do this in regular javascript? I think I can make a new ...
Juliennejuliet asked 17/6, 2017 at 4:29

3

Solved

I have trouble understanding the difference between putting .catch BEFORE and AFTER then in a nested promise. Alternative 1: test1Async(10).then((res) => { return test2Async(22) .then((res) ...
Creamcolored asked 2/2, 2017 at 21:59

2

since a while i am trying to reach something that doesn't work out for me so far. With nodejs, i like to run a interactive sh-command and work with the sh-command output after the command has exit...
Betoken asked 4/9, 2015 at 8:14

10

Solved

I'm using the Bluebird promise library under Node.js, it's great! But I have a question: If you take a look at the documentation of Node's child_process.exec and child_process.execFile you can see...
Marcellusmarcelo asked 10/6, 2015 at 17:37

7

I have Redis with a lot of keys in some format and I want to get keys that match some pattern and do some operations on them. I don't use KEYS method since it's not recommend in production. Using S...
Viator asked 5/6, 2016 at 14:0

19

Solved

Whether it's an ES6 Promise or a Bluebird Promise, Q Promise, etc. How do I test to see if a given object is a Promise?
Cuticle asked 2/1, 2015 at 17:47

4

Solved

I have a class that rejects a promise: Sync.prototype.doCall = function(verb, method, data) { var self = this; self.client = P.promisifyAll(new Client()); var res = this.queue.then(function()...
Mcgill asked 6/8, 2015 at 1:23

6

Solved

I have a promise that returns data and I want to save that in variables. Is this impossible in JavaScript because of the async nature and do I need to use onResolve as a callback? Can I somehow us...
Unshakable asked 28/4, 2016 at 9:59

10

Solved

I've been developing JavaScript for a few years and I don't understand the fuss about promises at all. It seems like all I do is change: api(function(result){ api2(function(result2){ api3(funct...
Functionary asked 20/3, 2014 at 16:49

4

Solved

In Bluebird's util.js file, it has the following function: function toFastProperties(obj) { /*jshint -W027*/ function f() {} f.prototype = obj; ASSERT("%HasFastProperties", true, obj); return...
Talus asked 28/7, 2014 at 3:0

2

How to reject a delayed Promise: const removeDelay = Promise.delay(5000).then(() => { removeSomething(); }); //Undo event - if it is invoked before 5000 ms, then undo deleting removeDelay.rej...
Prerecord asked 30/9, 2015 at 17:24

24

Solved

I want to work with promises but I have a callback API in a format like: 1. DOM load or other one time event: window.onload; // set to callback ... window.onload = function() { }; 2. Plain cal...
Severe asked 19/3, 2014 at 22:47

4

Solved

I have clients sending tasks to be performed by the server but these requests should be handled in a queue like fashion. Any idea how I can do this? Thanks. express.Router().post('/tasks', fu...
Enid asked 18/3, 2016 at 11:23

4

Solved

Consider the following code: import redis = require('redis'); //Has ambient declaration from DT import bluebird = require('bluebird'); //Has ambient declaration from DT bluebird.promisifyAll((&lt...
Gadget asked 12/4, 2016 at 3:23

8

Solved

I am still fairly new to promises and am using bluebird currently, however I have a scenario where I am not quite sure how to best deal with it. So for example I have a promise chain within an exp...
Mundy asked 27/9, 2014 at 16:2

1

What is the most efficient way of handling high volumes of promises? I've come up with 2 solutions and determined that Solution 2 (which uses bluebird's promise.map) is faster. Solution 1 (~38ms p...
Unthankful asked 23/11, 2019 at 20:37

3

Solved

I am working on one to many assocations with sequelize. Most tutorials and documentation shows examples when both models are defined in the same file. I currently have two files, first city.js: co...
Boyish asked 26/4, 2016 at 17:55

0

I'm trying to crawl several web pages to check broken links and writing the results of the links to a json files, however, after the first file is completed the app crashes with no error popping up...
Thales asked 8/6, 2021 at 16:31

4

Im not able to use bulk insert in my DB using node.js lib mysljs. I followed answers from: How do I do a bulk insert in mySQL using node.js with no success. var sql = "INSERT INTO resources (r...
Clawson asked 15/12, 2016 at 18:20

3

I'm trying to promisify the entire node_redis RedisClient object using Node 8's util.promisify in a manner similar to how Bluebird's promisifyAll() works, and not having much luck. This is what I'...
Forklift asked 8/8, 2017 at 10:49

1

We're experimenting with using --harmony_async_await in Node 7, and compared to transpiling with babel for async/await are missing the ability to have long stack traces (http://bluebirdjs.com/docs/...
Jodiejodo asked 18/11, 2016 at 6:41

3

Solved

I was writing code that does something that looks like: function getStuffDone(param) { return new Promise(function(resolve, reject) { myPromiseFn(param+1) .then(function(val) { resolve(val); ...
Ebbie asked 22/5, 2014 at 10:7

1

Short intro: We are starting to use npm ci for a more reliable installation of dependencies for our react application, instead of install. But we have been noticing some strange promise rejection b...
Amenra asked 16/1, 2019 at 12:59

4

I am creating a script in node.js (V8.1.3) which looks at similar JSON data from multiple API's and compares the values. To be more exact I am looking at different market prices of different stocks...
Cranny asked 30/6, 2017 at 15:33

© 2022 - 2024 — McMap. All rights reserved.