Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    probepublic

    Probe Build Status

    Ping and probe stuff

    Usage

    Ping something once

    const Ping = require('probe').Ping
     
    const config = {
      host: 'google.com',
      path:'/'
    }
     
    const expectResponse = {
      code: 200
    }
     
    const ping = new Ping()
    ping.start(config, expectResponse, (err, diff) => {
      if (err) {
        return console.error(err)
      }
      console.log(diff)
    })

    Probe something conitnuously

    const probe = require('probe')
     
    const config = {
      name: 'google-ping',
      time: {
        second: 50
      },
      host: 'google.com',
      path:'/'
    }
     
    const expectResponse = {
      code: 200
    }
     
    probe.add(config, expectResponse)
    probe.on('google-ping', () => {
      console.log('received ping')
    })

    License

    MIT

    install

    npm i probe

    Downloadslast 7 days

    1

    version

    2.2.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar