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 🙏

© 2026 – Pkg Stats / Ryan Hefner

we2

v1.0.27

Published

A process management app for production apps, similar to PM2

Readme

we2 CLI

A process management app for production apps, similar to PM2.

Installation

For Local Development

To install dependencies and make the we2 command available on your system for development, run the following commands from the project's root directory:

npm install  # Install local dependencies
npm link     # Create a global symlink to your local project

Global Installation (from source)

To install the package globally on your system directly from the source code (without publishing to npm), you can run this command from the project's root directory:

npm install -g .

Usage

Create a simple server file, e.g., app.js:

require('http').createServer((req, res) => res.end('hello')).listen(3000);

Start a process

we2 start app.js

Start with options

we2 start app.js --name myapp --instances max --watch --env production

Options:

  • -n, --name <name>: Specify app name
  • -i, --instances <instances>: Number of instances (max for all CPUs)
  • -w, --watch: Watch and restart on file changes
  • --ignore-watch <patterns>: Ignore watch patterns (comma-separated)
  • --max-memory-restart <limit>: Restart if memory exceeds limit (e.g., 200MB)
  • --restart-delay <ms>: Delay between restarts
  • --log <path>: Specify log file
  • --no-autorestart: Disable auto restart
  • --env <env>: Environment (development, production)

List running apps

we2 list

Show details

we2 show myapp

Restart the app

we2 restart myapp

Stop the app

we2 stop myapp

Delete the app

we2 delete myapp

Tail logs

we2 logs myapp

Monitor processes

Generate ecosystem file

we2 ecosystem

Other commands

  • we2 flush [name|all]: Flush logs
  • we2 save: Save process list
  • we2 update: Update we2

Running on System Boot (Production)

To ensure the we2 daemon starts automatically when your server reboots, you need to create a service file for your operating system.

Example for Linux with systemd

  1. Create a service file:

    sudo nano /etc/systemd/system/we2-daemon.service
  2. Add the following content. Make sure to replace /path/to/node and /full/path/to/your/project/we2_cli/daemon.js with the actual absolute paths on your system. You can find the path to Node by running which node.

    [Unit]
    Description=we2 Process Manager Daemon
    After=network.target
    
    [Service]
    ExecStart=/path/to/node /full/path/to/your/project/we2_cli/daemon.js
    Restart=always
    User=your-username # Replace with the user you want to run the service as
    Environment=NODE_ENV=production
    
    [Install]
    WantedBy=multi-user.target
  3. Enable and start the service:

    sudo systemctl daemon-reload      # Reload systemd to recognize the new file
    sudo systemctl enable we2-daemon  # Enable the service to start on boot
    sudo systemctl start we2-daemon   # Start the service immediately
    sudo systemctl status we2-daemon  # Check the status of the service

Other Operating Systems

  • macOS: You would use launchd and create a .plist file in ~/Library/LaunchAgents.
  • Windows: You can use a tool like node-windows to wrap the daemon.js script as a Windows Service.