
Pin
Is my site up? Node.js edition.
Install
$ npm install pin
Usage
var pin = require('pin');
pin('http://google.com/')
.interval(10000)
.up(function(response) {
console.log(response);
})
.down(function(error, response) {
console.log(error, response);
});
Both "up" and "down" are optional.
Check if text is present in the body:
var pin = require('pin');
pin('http://google.com/')
.interval(10000)
.text('Google')
.up(function(response) {
console.log(response);
})
Register custom validator:
var pin = require('pin');
var validator = function(err, response, body) {
return true;
};
pin('http://google.com/')
.interval(10000)
.register(validator)
.up(function(response) {
console.log(response);
})
Features
- Super minimalistic api
- Custom drivers, switch between superagent, request or your awesome driver
- Custom validators
- Check if text is present in the body
Todo
Tests
$ npm install
$ make test
License
MIT License