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

moniter

v1.0.15

Published

A lightweight Node uptime monitoring tool

Downloads

6

Readme

The moniter logo.

GitHub license npm version PRs Welcome

Our Story

First prototyped in Feldkirch, Austria, then built out in full at the Umma Hüsla Hackathon "Reboot", October 2021

Want a dashboard, data persistence, logs, support, and more? Try moniter Enterprise at moniter.org - built upon this very package! 😄

Otherwise, follow the remaining documenation to see how you can use moniter at your own organization.

Get Started

  1. Install the moniter package in your project:
npm install --save moniter
  1. Setup configuration files:
  • Copy the entire contents of the folder example/src/config/moniter to your project and modify all the configuration files:

  • url-config.ts: the list of URLs and the intervals at each that you want to monitor them.

  • alert-config.ts: the list of alert methods you wish to be notified by

  • email-config.ts: the email settings if you wish to be notified by email

  • slack-config.ts: the Slack webhook if you wish to be notified by slack

*** More contact methods are coming soon! ***

Once these files have been created, do not check them into git! They potentially contain secrets!

  1. Create a new .ts file (in this example named moniter-config.ts) and import these configuration files and create a variable that corresponds to the IConfigConfig interface:
// src/config/moniter/moniter-config.ts
import { IConfigConfig } from 'moniter';
import urlConfig from './url-config.js';
import alertConfig from './alert-config.js';
import emailConfig from './email-config.js';
import slackConfig from './slack-config.js';

const config: IConfigConfig = {
  urlConfig,
  alertConfig,
  // TODO: add once properly configured for your organization:
  // emailConfig,
  // slackConfig,
};

export default config;

Note that according to IConfigConfig, at least a urlConfig and an alertConfig is required. This example follows the example/ folder and uses only the AlertMethod.CONSOLE alert type.

  1. Import moniter, and your newly created config and call monitor(config) to start monitoring! Or call runImmediately(config) to ignore the cron values and check all URLs immediately.
// index.js
import moniter, { runImmediately } from 'moniter'
import config from './src/config/moniter/monitor-config.js'

moniter(config);

// alternatively, run immediately for all URLs!
// runImmediately(config);

Question: Why the use of the .js file extension everywhere when these are TypeScript files?

Answer: moniter is trying to be very cool and uses esm to package itself. This requires that write our imports filepaths with their compiled file paths(s), i.e., .js.

TypeScript unfortunately does not consider it a responsibility for their library. See more here

Don't want to do all these steps yourself? Try moniter Enterprise at moniter.org - built on this very package! 😄

Example: Run With Forever

To have an on premise site uptime checker you can use anywhere, you can run moniter by using the tool forever:

forever start index.js

This will restart your index.js process if moniter crashes at any time.

See forever's repository for more information.

(We're not sponsored by forever in any way, we just think it's a cool tool! 😄)

Example

See a working example in the example/ folder.