node-challonge
node-challonge copied to clipboard
Promises?
Or at least allowing callback to be passed as the second argument so that promisfy libraries will work nicely.
This would have to be in a major version bump unless it was done in a backwards-compatible manner.
To be backwards-compat, would require:
- callback object property
- callback function as second argument
- promise chaining
Could we make it an option where legacy could be a boolean (indicating callback = true while promises = false) and the default will be false?
If we are going to support everything, we shouldn't need to flag it, just check if the callback property is there, or the final argument to the call is a function, and return a promise from each call.
However, since we need to bump to 2.0 anyway to resolve the challonge-js merge, we might consider just switching to promises anyway for 3.0.
I think I'll mark this as a 3.0 feature for now.
I would still support both fallback and promises. I would also try and use superagent, which is pretty awesome to use.