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
Your callback function parameters are reversed when compared to conventional pattern of callback(err, data){}. Wrapping the init function into a Promise erroneously returns an error since the data is being passed as the first parameter.
license.init('/path/to/package', function(licenseMap, err){
if (!err) {
console.log(licenseMap);
}
});
The text was updated successfully, but these errors were encountered:
Here is an example of how I was using it. I used the Q promise library to wrap the callback into a promise.
var bowerLicense = require('bower-license');
var Q = require('q');
var licenseInit = Q.denodeify(bowerLicense.init);
licenseInit('path')
.done(function (licenses) {
// Do stuff with licenses
});
Your callback function parameters are reversed when compared to conventional pattern of
callback(err, data){}
. Wrapping theinit
function into a Promise erroneously returns an error since the data is being passed as the first parameter.The text was updated successfully, but these errors were encountered: