rtteo
v0.1.0
Published
A library to create daemons which do some operations based on some emails' objects.
Downloads
7
Readme
rtteo
A very minimal and lightweight mail listener written in Node.
Usage
const { Rtteo } = require('rtteo')
// An email with a subject like 'Alarm from: ets XYZ Corp' will result in:
// Type: alarm, Company: XYZ Corp.
const rtteo = new Rtteo({
// You can define whatever mail provider you like editing the config/default.json file
provider: 'gmail',
email: '[email protected]',
password: 'password',
subjects: {
alarm: new RegExp('Alarm from: ets (.*)'),
info: new RegExp('Info from: ets (.*)'),
warning: new RegExp('Warning from: ets (.*)')
}
}, (email, type, matches) => {
const dest = matches[1]
console.log(`Type: ${type}, To: ${dest}`)
})
rtteo.connect()
License
rtteo is released under GNU/GPL v3.