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

@daemonitor/client

v1.0.13

Published

This is the client for Daemonitor. It can be used to monitor your devices and send events to the Daemonitor server.

Downloads

3

Readme

Daemonitor Client

This is the client for Daemonitor. It can be used to monitor your devices and send events to the Daemonitor server.

Run with PM2:

Clone the repository and install dependencies:

git clone https://github.com/daemonitor/client.git
cd client 
pnpm install

Setup your client.config.json and .env files:

cp client.config.json.example client.config.json
cp .env.example .env

Start the client with PM2:

pm2 start npm --name daemonitor-client -- run start

Install as a service using systemd

Note: you will not be able to use the PM2 monitoring plugin if you install as a service.

Setup your configuration file at /etc/daemonitor/client.config.json

sudo cp client.config.json.example /etc/daemonitor/client.config.json
sudo cp .env.example /etc/daemonitor/.env

Install the package globally:

sudo npm install -g @daemonitor/client

You should now be able to run the client from the command line:

daemonitor-client

Install the service:

sudo cp daemonitor-client.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable daemonitor-client
sudo systemctl start daemonitor-client

Configuration

The client can be configured using the client.config.json file. The following options are available:

| Option | Description | Options | |----------------|--------------------------------------|-----------------------------------| | connectors | An array of connectors to load. | ["rest-api", "console"] | | plugins | An array of plugins to load. | ["os", "pm2", "ewelink", "web"] | | [plugin alias] | An object of options for the plugin. | See plugin documentation. |

Plugins

OS

The OS plugin provides information about the operating system.

PM2

The PM2 plugin provides information about PM2 processes.

| Option | Description | Default | |--------|-------------|---------| | processes | An array of process names to monitor. | [] |

Web

The Web plugin provides information about web services.

| Option | Description | Default | |--------|-------------|---------| | endpoints | An array of endpoints to monitor. | [] |

Endpoints can be configured with the following options:

| Option | Description | Default | |--------|-------------|---------| | name | The name of the endpoint. | | | url | The URL of the endpoint. | | | method | The HTTP method to use. | GET | | headers | An object of headers to send. | {} | | body | The body to send. | | | interval | The interval to poll the endpoint. | 60000 | | timeout | The timeout for the request. | 5000 | | expectedStrings | An array of strings that should be present in the response. | [] | | expectedStatusCode | The expected status code. | 200 | | unexpectedStrings | An array of strings that should not be present in the response. | [] | | unexpectedStatusCode | The unexpected status code. | 200 | | expectedResponseTime | The expected response time. | 1000 | | unexpectedResponseTime | The unexpected response time. | 1000 | | expectedResponseSize | The expected response size. | 0 | | unexpectedResponseSize | The unexpected response size. | 0 |

EWeLink

The EWeLink plugin provides information about EWeLink devices.

| Option | Description | Default | |--------|-------------|---------| | email | EWeLink email address. | | | password | EWeLink password. | | | region | EWeLink region. | us | | devices | An array of device IDs to monitor. | [] |

Connectors

Console

The Console connector logs events to the console.

| Option | Description | Default | |--------|-------------|---------| | level | The minimum log level to log. | info |

REST API

The REST API connector sends events to a REST API.

| Option | Description | Default | |--------|-------------|---------| | url | The URL of the REST API. | | | token | The token to use for authentication. | | | level | The minimum log level to log. | info | | interval | The interval to send events. | 10000 | | timeout | The timeout for the request. | 5000 | | maxRetries | The maximum number of retries. | 3 | | retryDelay | The delay between retries. | 1000 | | retryBackoff | The backoff factor for retries. | 2 | | retryJitter | The jitter factor for retries. | 0 |