An open API service indexing awesome lists of open source software.

https://github.com/eljefedelrodeodeljefe/probe

Probe stuff.
https://github.com/eljefedelrodeodeljefe/probe

check http ping probe

Last synced: about 1 month ago
JSON representation

Probe stuff.

Awesome Lists containing this project

README

          

# Probe [![Build Status](https://travis-ci.org/eljefedelrodeodeljefe/probe.svg?branch=master)](https://travis-ci.org/eljefedelrodeodeljefe/probe)

> Ping and probe stuff

## Usage

Ping something once
```js
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
```js
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