Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

pin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pin

Is my site up? Node.js edition.

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
23
130%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Pin

Is my site up? Node.js edition.

Install

$ npm install pin

Usage

var pin = require('pin');

pin('http://google.com/')
  .interval(10000) // in ms
  .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) // in ms
  .text('Google')
  .up(function(response) {
      console.log(response);
   })

Register custom validator:

var pin = require('pin');

var validator = function(err, response, body) {
  // your custom checks here
  // it must return bool

  return true;
};

pin('http://google.com/')
  .interval(10000) // in ms
  .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

  • Custom headers

Tests

$ npm install
$ make test

License

MIT License

Keywords

ping

FAQs

Package last updated on 22 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts