Home / Companies / Couchbase / Blog / Post Details
Content Deep Dive

Bluebird Promises and Swagger in Node.js

Blog post from Couchbase

Post Details
Company
Date Published
Author
Hod Greeley, Developer Advocate, Couchbase
Word Count
297
Language
English
Hacker News Points
-
Summary

I recently switched from using synchronous calls to Promises with the Bluebird library in my Node.js application, but encountered an issue when trying to use the `return` function, which creates a Promise that resolves to a given value. I was getting errors because the Swagger JS client uses the Q Promises library instead of Bluebird, causing promises returned by my calls to be replaced with the Q version. To address this, I decided to stick with using the equivalent `then` call or consider alternatives such as `promisifyAll`, using the "bluebird-q" project to replace Q with Bluebird, or wrapping calls with `Promise.resolve()`.