Questions tagged [bluebird]

Bluebird is a fully featured promise library for client and server JavaScript with focus on innovative features and performance.

Bluebird is a fully featured promise library for client and server JavaScript code with focus on innovative features and performance.

Bluebird is known for its fast performance, context binding, and long stack traces. It offers very fast coroutine support that emulates C#'s async/await statement.

Bluebird's promise system also cures JavaScript's callback problem.

It is a fully A+ spec compliant implementation.

Bluebird supports both Node.js and browsers (with Browserify and directly).

1871 questions
0
votes
1 answer

How do I wait for a pull?

I need to run a container from node so I'm using the dockerode module, which uses the Docker API. To run a container I first need to pull the image (if it doesn't exist locally). I've promisified the calls for simplicity but I'm having difficulty…
ekkis
  • 9,804
  • 13
  • 55
  • 105
0
votes
1 answer

Recovering from failure with promises

working with dockerode (a docker module) I need to implement the following workflow: create container if creation fails, pull container, then create container run container so it looks roughly like: docker.createContainer() .catch(function (e)…
ekkis
  • 9,804
  • 13
  • 55
  • 105
0
votes
0 answers

Bluebird Promise.map child_process.execFile - read output from callback

I am brand new to bluebird and trying to instantiate multiple child_process.execFile's by using Promise.map and read/combine all of their stdout at completion. Right now, in order to execute one execFile and read the error, stdout, and stderr I do…
Jeremy
  • 1,717
  • 5
  • 30
  • 49
0
votes
0 answers

Promisify read csv files into json with Bluebird function

I am a beginner using the promise bluebird in node js to read all the csv files and convert to json in a bluebird function, but for some reason I can't get it right. var Promise = require('bluebird'); var join = Promise.join; var fs =…
Big Skinny
  • 53
  • 7
0
votes
1 answer

Asyncronously mapping over a collection with a function that returns a promise

I'm trying to learn how to use Bluebird promises and I am a bit lost. I have two database tables: topic and subject. The topic table has a subject_id column, which can then be used to query the subject table for the subject title. I have an orm…
Luke
  • 5,567
  • 4
  • 37
  • 66
0
votes
2 answers

Node/MySQL2/bluebird promises not working

I have the following code: var Promise = require('bluebird'); var mysql = require('mysql2/promise'); var pool = mysql.createPool({ host: 'localhost', user: 'root', password: 'root', database: 'crux' }); Database.prototype.listProjects = function…
drekka
  • 20,957
  • 14
  • 79
  • 135
0
votes
1 answer

Handle http responses differently with bluebird Promise

I'm new to promises. Seems like they should make things easier. But I can't figure this out. I want to handle a promise based on the http status code. Ie 200 vs 301 (PS this is in coffeescript) So I'm using express and I have a promise express =…
anthony galligani
  • 386
  • 1
  • 3
  • 16
0
votes
2 answers

Bluebird detection

For a library that supports any promise library, yet wants to know when Bluebird is specified, in which way should it verify for it? - that would be simple and reliable that would not likely break with later versions of Bluebird var promise =…
vitaly-t
  • 24,279
  • 15
  • 116
  • 138
0
votes
0 answers

Causes for bluebird's promisify not working

I have an API which implements bluebird.js. I've got two methods with basically the same flow, one works, the other doesn't. Looking for ideas on what could be wrong. The flow in words is as follows: Promisify an api. Create an array of promises…
alexunder
  • 2,075
  • 3
  • 16
  • 29
0
votes
1 answer

Possible Promise Issue

Hi this works for the first execution but then when I try again it seems to break, does anything seem wrong with the way the promises are used here socket.on('new user', function(data, callback) { return getUsersFromDb() .then(function()…
julianmp
  • 13
  • 3
0
votes
2 answers

Using Promise.all to wait until all callbacks have completed

I am trying to make two HTTP requests to retrieve data, each of which has a callback function. Only after both callback functions have completed do I want to run the final bit of code. Maybe it's my unfamiliarity with promises, but I can't seem to…
greymatter
  • 840
  • 1
  • 10
  • 25
0
votes
1 answer

error makeNodePromisified is not a function when bundling bluebird with webpack

When I bundle bluebird with webpack and target node I'm getting the following error - makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); ^ TypeError: makeNodePromisified is not a function at promisifyAll (...) at…
Josh Unger
  • 6,717
  • 6
  • 33
  • 55
0
votes
1 answer

Bluebird promise leak warnings

In a public library spex that I wrote awhile ago and that proved to be very reliable, I've been struggling to locate the reason why Bluebird is warning me with Warning: a promise was created in a handler but was not returned from it. After trying to…
vitaly-t
  • 24,279
  • 15
  • 116
  • 138
0
votes
1 answer

Bluebird promise multi-level

I am struggling to figure out how to have multiple levels of promises execute asynchronously. I have searched through the documentation but most promise libraries have you waiting for all promises to do some logic or one then the next. I need an…
lostAstronaut
  • 1,331
  • 5
  • 20
  • 34
0
votes
1 answer

promise.all then structure not working as expected

I am pretty new on Node stuff so I do apologise in advance if it is quite basic. I am trying to trigger a function once, three asynchronous functions have already finished. This is my approach: First file: ./promise.js var reqHandler =…
shockes
  • 3
  • 1
1 2 3
99
100