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

ps-dock

v0.4.3

Published

Simple process monitoring utility

Downloads

12

Readme

Ps-dock

Very simple and uncrashable process monitoring tool

Installation

It can be installed with npm.

npm install ps-dock -g

#Usage ###Basic Ps-dock can launch a process very simply, in this way:

ps-dock ls --stdout test.log

###Config Config file can be specified in this way :

ps-dock bash --stdout test.log --config-file /home/config

By default, ps-dock will search for a file name .psdockrc in current home or current directory. To specify an other directory, you can use --config option:

ps-dock bash --stdout test.log --config /home

Here is an example of .psdockrc :

WEB_HOOK_URL=http://localhost:3000
LOGROTATION=daily
BIND_PORT=true
DROP_UNHANDLED_LOGS=true
DISTANT_SOCKET= 
DATA_TO_SOCKET=Hello World
TIMEOUT=30000

###Stdout Three types of stdout can be specified :

  • Logfile

    For instance, you can specify a file name test.log to ps-dock. then it handles logrotation : by defaults, log files are rotated every day, but you can tell to ps-dock to rotate logs every second, every minute, every hour, every day, or every week in this way:

      ps-dock bash --stdout test.log --log-rotate hourly
  • TCP Socket A distant socket to which send datas from process. Process input is plugged to this socket...

      ps-dock bash --stdout socket://localhost:666

    Data can be sent on connection to the distant socket in this way:

      ps-dock bash --stdout socket://localhost:666/hello_world
  • TLS Socket

      ps-dock bash --stdout tls://localhost:666
        

###Web Hook A web hook can be specified as an environment variable:

WEB_HOOK_URL="http://localhost:666/hello_alice?name=boris" ps-dock bash --stdout test.log

Or in config file as specified before. It will send informations about status of process launched by ps-dock to the web hook. Body of datas sent are formatted likethis :

{ps: { status: stat}}

###BindPort If bind-port is set to true then ps-dock will wait that process open port specified in environment variable to inform Web Hook that process status is up.

export PORT=2000
WEB_HOOK_URL="https://localhost:666/hi?who=world" ps-dock nc -l $PORT --stdout test.log --bind-port true

###DropUnhandledLogs Sometimes, process emits too many logs. Trying to redirect them all to a file or a socket could slow the process. So, by default, if there is too many logs, they are dropped.

ps-dock bash --drop-unhandled-logs true