Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
; (async function () {
var options = {
lapse: values.lapse,
percentageDiff: values.percentage
? values.percentage
: await bp(values.NumberOfTest, values.uri) // if whileControl exist this will not use
}
let wp = wm.monitor(values.uri, options)
.start()
.on('start', (uri) => console.log(`monitoring of '${uri}' start`))
.on('alert', (uri, page) => {
if (values.email && values.email.length === 3) {
transporter.sendMail(mailOptions, function (error, info) {
if (error) {
console.log(error)
} else {
console.log('Email sent: ' + info.response)
}
})
} else {
console.log(`page ${uri} chaged`)
}
if (!values.loop) wp.stop()
})