Files
fredy/lib/notification/adapter/console.js

16 lines
557 B
JavaScript
Raw Normal View History

2018-01-20 20:23:27 +01:00
/**
* simply prints out the found data to the console
* @param serviceName e.g immoscout
* @param newListings an array with newly found listings
* @param notificationConfig config of this notification adapter
2018-01-20 20:23:27 +01:00
*/
exports.send = (serviceName, newListings, notificationConfig) => {
const { enabled } = notificationConfig.console;
if (!enabled) {
return [Promise.resolve()];
}
/* eslint-disable no-console */
return [Promise.resolve(console.info(`Found entry from service ${serviceName}:`, newListings))];
/* eslint-enable no-console */
2018-01-20 20:23:27 +01:00
};