You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functions in this library sadly do not follow the Node standard of
function(a, b, c, callback)
where callback is akin to
callback(err, data)
And err is an Error Object, while data is an object or array encompassing any possible result.
Instead they are defined with a callback like this
callback(err, ...data)
This makes these functions pretty hard to work with. For example, when trying to promisifying them with util.promisify they won't work, because util.promisify expects callbacks with at most two arguments.
Since there seems to be quite a large focus on Node standards, HTTP standards and standard cookie management throughout the entire library I've been wondering why the error data callback convention is not followed here.
The text was updated successfully, but these errors were encountered:
Changing this is obviously a breaking change, but I think it would be worth it to think about since then all functions which accept callbacks fit neatly into the node standard library. Alternatively to breaking backwards compatibility with a 4.0 update, one could provide async alternatives of functions which are already features in this library.
I would be willing to open a PR which adds async alternatives for all functions where applicable.
The functions in this library sadly do not follow the Node standard of
where callback is akin to
And
err
is an Error Object, whiledata
is an object or array encompassing any possible result.Instead they are defined with a callback like this
This makes these functions pretty hard to work with. For example, when trying to promisifying them with
util.promisify
they won't work, becauseutil.promisify
expects callbacks with at most two arguments.Since there seems to be quite a large focus on Node standards, HTTP standards and standard cookie management throughout the entire library I've been wondering why the error data callback convention is not followed here.
The text was updated successfully, but these errors were encountered: