UNPKG

hyperbutter-weather

Version:

A plugin to get weather from Yahoo and send it into the Hyper Butter server

32 lines (28 loc) 636 B
'use strict'; const Weather = require('./index'); const plugin = new Weather({ places: [ 'San Jose, CA', 'Strathroy, ON', ], }); plugin .on('status', (...args) => { args.unshift('STATUS:'); console.log.apply(this, args); }) .on('debug', (...args) => { args.unshift(' DEBUG:'); console.log.apply(this, args); }) .on('error', (...args) => { args.unshift(' ERROR:'); console.error.apply(this, args); }) .on('update', (data) => { console.log('UPDATE:', data); console.log('\n\nTest passed!'); process.exit(); }); // call init if we have one if (plugin.init) plugin.init();