How to use web-monitoring - 1 common examples

To help you get started, we’ve selected a few web-monitoring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antoniomuso / web-monitoring-app / web-monitoring.js View on Github external
; (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()
            })

web-monitoring

Simple web monitoring in nodejs

MIT
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis

Popular web-monitoring functions

Similar packages