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

pm2sd

v0.0.48

Published

Node.js Process Manager over systemd service

Downloads

7

Readme

pm2sd

PM2SD is a process manager for Node.js applications (or other scripts) built over system services. It is inspired by PM2, but not that complex and uses far less memory (i.e. zero memory as it is wrapper for systemd service at Linux, for instance). I love PM2, but cannot use it on small VPS for pet projects, so meet the PM2SD!

You can start process as simple as

$ pm2sd start index.js

Process will be started as system service (i.e. added to /etc/systemd/system at Linux), enabled for restart after reboot, will restart in 30 seconds if it crashes, output and error logs goes to /var/log/pm2sd-<name> (if you want configure and start service under non-privileged user, you need to do some magic).

No clusters, no load balancers, no watching, just one living process.

It works on Linux, and Windows is in the plans :construction: :hammer:.

Commands

Implemented commands: ls, start, stop, restart, delete, log.

ls

Lists all pm2sd services. Also, you can get list of all system services with option --all:

$ pm2sd ls --all

You can filter list of all services by part of its name with pm2sd ls <name>.

Also you can use --json option to get json instead of colored text output.

start

Starts new process. Avaliable options: name, description, time, user (i.e. service can be started from any user). --time adds timestamp to logs.

$ pm2sd start index.js --name=test --user=node --time

stop

Stops process (by its name).

restart

Restarts process (by its name).

delete

Delete all traces of process (include logs).

log

Tails log of selected process (pm2sd log <name>) or logs for all processes if nothing specified (pm2sd log).

Troubleshooting

  1. If you've got Failed to connect to D-Bus that means you're trying to work under non-root user, which requires the systemd user service to be started (look at this).

  2. If service does not start at boot for non-root user, please check if user lingering is enabled (look at this).