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

guvnor

v3.5.17

Published

A node process manager that isn't spanners all the way down

Downloads

71

Readme

The Guv'nor

Discuss Tasks Build Status Dependency Status Coverage Status

Noun 1. guvnor - (British slang) boss

A node process manager that isn't spanners all the way down.

Features

  • Monitoring via console or web
  • Configure user/group to run processes as
  • Auto process restart on crash
  • Log redirection to per process out/err files
  • Cluster support
  • Monitor process CPU/memory/event loop latency
  • Remotely trigger GC/heap dump
  • Debug remote processes
  • Store exception stack traces and logs for post-crash analysis

Command line interface

cli

Use guv (or guvnor if you're not into the whole brevity thing).

## Web interface

Start the web interface with (can be run without guvnor running in the background - for example if you want to monitor one or more guvnor servers from a different machine that is not running guvnor):

$ guv-web

or run the web interface under guvnor itself (please read the guvnor web setup section first!):

$ guv web

guvnor-web

Install

npm install -g guvnor --unsafe-perm

Why --unsafe-perm? Guvnor uses a fair few native modules that require access to /root/.npm and /root/.node-gyp when building. At the moment this is the only way to allow access.

Upgrading

npm's upgrade command is a big angry box of wasps so to be sure, kill guvnor, remove it, reinstall and start it.

guv kill
npm remove -g guvnor
npm install -g guvnor
guv

For instructions on how to move between breaking versions, see upgrading

## Usage

Comprehensive help is available on the command line:

guv --help

and with more detail for each subcommand, e.g.:

guv start --help

The first time you invoke a guvnor command, the daemon will start in the background. Because guvnor can run processes as different users, it needs to be able to switch to those users. Consequently you should start guvnor as root or another privileged user.

Help

  1. Starting and stopping processes
  2. Controlling the Daemon
  3. Managing clusters
  4. Installing and running apps
  5. Remote access and monitoring (e.g. guvnor-web)
  6. Web interface
  7. Web interface - configuration
  8. Web interface - user management
  9. Programmatic access
  10. Programmatic access - local
  11. Programmatic access - remote
  12. Programmatic access - events

Configure

A configuration file if run as root can be placed at /etc/guvnor/guvnor. Take a look at the default configuration file for details.

If you create a configuration file, it will be merged with the default configuration, so if you only want to override one property, you need only specify one property in your config file.

Starting guvnor on boot

Guvnor comes with a sysv init script. To configure it to run on system boot run the following:

$ sudo ln -s /usr/local/lib/node_modules/guvnor/scripts/init/sysv/guvnor /etc/init.d/guvnor
$ sudo update-rc.d guvnor defaults

To undo this, run:

$ sudo update-rc.d guvnor remove
$ sudo rm /etc/init.d/guvnor

apt-get

If you installed node via apt-get install nodejs, you should create a symlink to the nodejs binary:

$ sudo ln -s /usr/bin/nodejs /usr/bin/node

Also, the init script is probably stored at /usr/lib/node_modules/... instead of /usr/local/lib/node_modules/... - please check your filesystem to be sure.

Docker

See the sample Dockerfile for how to run guvnor with Docker.

In the Dockerfile there are two variables - GUVNOR_ROOT_SECRET and GUVNOR_USER_SECRET - you should change these to a long random string unique to your install before building the container.

Once you'd done that, build the container and run it with the commands below. The -p option forwards a port used by guv-web to connect to the instance of guvnor in the container, so forward the port as appropriate to your setup.

$ sudo docker build -t guvnor .
$ sudo docker run -p 57484:57483 -d guvnor

To connect guv-web to your docker container, add something like the below to your guvnor-web-hosts file:

[docker]
  host = localhost
  port = 57484
  user = root
  secret = GUVNOR_ROOT_SECRET

...and to your guvnor-web-users file:

[alex.docker]
  user = guvnor
  secret = GUVNOR_USER_SECRET

Replace GUVNOR_ROOT_SECRET and GUVNOR_USER_SECRET with whatever you defined in the Dockerfile.

Development

Vagrant setup

It's useful to be able to set up and tear down fresh VMs to do testing, so a Vagrant file is available. It's configured to run Debian Jessie and install the latest versions of Node and Guvnor.

Once Vagrant is installed, cd into the vagrant directory and run:

$ vagrant up
$ vagrant ssh
$ sudo npm install -g guvnor

Then when you are done, to shut the machine down exit your SSH session and run:

$ vagrant destroy

Docker

Install docker on vagrant with

wget -qO- https://get.docker.com/ | sh

Then cd to /docker and build & run guvnor

sudo docker build -t guvnor .
sudo docker run -p 60000-60020:60000-60020 -d guvnor

Changelog

See the changelog