npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vermont

v0.0.1

Published

serVER MONiTor

Downloads

3

Readme

vermont

Build Status Coverage Status

Server monitoring tool

Vermont allow you to check your server's state. It can ping urls and exec shell commands.

Usage

Vermont available to use right in JS code and as a CLI application. The both checks (ping and exec) require parameter expected to be specified. It may be a number or a string. Vermont compares different values in order to expected type.

|expected|ping |exec | |--------|----------------------|--------------| |number |response status code |exit code | |string |response body |command stdout|

For example: if you need to check that url answers 200 status code you should set expected to 200. But if you want to know that url answers 'ok' in its body you may set expected to 'ok'. The exec method works just as well.

NOTE: If type of expected is a string it will be used as a regular expression.

NOTE: If expected parameter is not specified Vermont will use 200 for ping or 0 for exec as default.

JS code

Install

npm i vermont

Usage

var vermont = require('vermont');

vermont.ping('http://mysite.com', 200)
  .then(function(){ console.log('OK'); })
  .catch(function(error){ console.log('fail'); });

Error object format

For ping method:

{
  action: 'ping',
  url: 'http://mysite.com',
  expected: 200,
  received: 502,
  status: 'error'
}

For exec method:

{
  action: 'exec',
  url: 'echo 2+2',
  expected: 5,
  received: 4,
  status: 'error'
}

CLI

Install

npm i -g vermont

Usage

vermont [OPTIONS] -f <CONFIG_FILE>

Available options

  -f, --file  Path to the config file
  -s, --sync  Run checks synchronously
  -h, --help  Show help

Config file

Vermont config file contains checks. So far Vermont can only check different urls. Here is the example of config that checks some urls:

[
  {
    "name": "test-1",
    "ping": "https://yandex.ru"
  },
  {
    "name": "test-2",
    "ping": "https://google.com"
  },
  {
    "name": "test-3",
    "ping": "https://facebook.com"
  }
]