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
@MathieuDerelle you can use bluebird's promisifyAll, I am using it and works like a charm, for example:
var clientEs = new bot({
protocol: 'https', // Wikipedia now enforces HTTPS
server: lang + '.wikipedia.org', // host name of MediaWiki-powered site
path: '/w', // path to api.php script
debug: false // is more verbose when set to true
});
Promise.promisifyAll( clientEs );
clientEs.getPagesInCategoryAsync(category)
.then(function(data) {
console.log(JSON.stringify(data.map(function(el) {
return el.title;
})));
});
every function could return a Promise if no callback are passed :
const promise = bot.getCategories('foo')
The text was updated successfully, but these errors were encountered: