Rozbot/lib/promise/feed.js

15 lines
288 B
JavaScript
Raw Normal View History

2016-07-11 23:24:15 -04:00
var feed = require('feed-read');
var promise = require('promise-polyfill');
module.exports = function(link) {
return new promise(function(resolve, reject) {
feed(link, function(error, articles) {
if (error) {
reject(error);
} else {
resolve(articles);
}
});
});
}