From the documentation of Q (the Javascript promise library):
Q.longStackSupport = true;
This feature does come with somewhat-serious performance and memory overhead, however. If you're working with lots of promises, or trying to scale a server to many users, you should probably keep it off. But in development, go for it!
I find myself always writing code like this:
var Q = require('q');
Q.longStackSupport = true;
However, if I decided to turn off longStackSupport
, I would have to touch a lot of files in my code.
So, I wonder if there is a more elegant solution:
- Is there a recommended pattern when including Q?
- Is it sufficient to call
Q.longStackSupport
only once?