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

another-one-bites-the-dust

v0.2.0

Published

Any services status monitor. It will help answer the question "Is everything okay?"

Downloads

13

Readme

another-one-bites-the-dust

Any services status monitor. It will help answer the question "Is everything okay?"

image

Features

  • Easy configuration
  • It's standalone service. You can use it to check resources on a private network
  • You can write your own checkers and check whatever you want
  • Groups of checks (for different types of checks or different environments for example)
  • JavaScript (I'm so sorry)

It's not for

  • Alerts and notifications
  • Retrospective

Built-in checkers

  • Simple HTTP status checker
  • Dockerflow __heartbeat__ checker

How to use

You will need Node.js v12+.

Simple way

Fork boilerplate app or just clone it.

git clone [email protected]:gwer/another-one-bites-the-dust-app.git
cd another-one-bites-the-dust-app
yarn
yarn start

Don't forget to write your own config.

Note: cloned repository is another-one-bites-the-dust-app. It is not recommended to clone the current repository for direct use.

From scratch

yarn add another-one-bites-the-dust
// index.js

const server = require('another-one-bites-the-dust');
const config = require('./config');

server(config);
node index.js

Config example

example_config.js

Built-in checkers options

Only url is required.

{
  url,
  expectedHttpCode = 200,
  timeout = 30000,
  warningTimeout = 5000
}

How to write your own checkers

Checker is async function that returns the result in the following format:

Promise<{
  "status": "ok"|"warning"|"error",
  "details"?: string,
}>

Simple checker

const myChecker = () => ({ status: 'ok' });

Checker arguments

Let's imagine you need a strange checker that checks the performance of adding numbers.

const myChecker = (expectedExecutionTime, count) => () => {
  const startTime = performance.now();
  let sum = 0;

  for (let i = 0; i < count; i++) {
    sum += i;
  }

  const endTime = performance.now();

  if ((endTime - startTime) > expectedExecutionTime) {
    return { status: 'warning', details: 'So slow...' };
  }

  return { status: 'ok' };
};
const config = {
  ...
  {
    name: 'Strange check',
    checker: myChecker({ expectedExecutionTime: 100, count: 10000 }),
  },
  ...
}

Alternatives

If you need something simpler, try tinystatus.

If you need something more complicated, with alerts and checks history, try Gatus.