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

mr-manager

v0.0.3

Published

Process manager for running stuff

Downloads

6

Readme

Mr. Manager

Generic process monitor/manager for development environments. You can run multiple commands in the same shell, track their state from building to ready (or failure if you made a mistake). Has some nice bonuses like autoreload and more in the works.

Running

Any of the following aliases will work to get mr-manager up and running:

mr-manager
mr-man
mrm

Command Line Options

You may supply one or more positional arguments to run a subset of the commands defined in your config file e.g.

mrm frontend *-svc backend-*

The following named arguments are supported:

  • -c - config file location, if not specified looks for mrm.toml or mrm.yaml in the cwd

Config File Format

Config files can be specified in either yaml or toml. For the sake of conciseness and familiarity, we'll go with yaml for the example.

version: "exp"

commands:

  - name: "backend"
    command: "node"
    args:
      - "index.js"
    watch:
      - "./backend/*.js"
    options:
      cwd: "./backend"
    ready:
      - "Listening on"

    install:

      - name: 'deps'
        command: 'yarn'
        args:
          - "install"
        options:
          cwd: "./backend"

  - name: "frontend"
    command: "yarn"
    args:
      - "webpack"
    building:
      - "Compiling"
    ready:
      - "Compiled"
      - "Built at"
    failed:
      - "Failed to compile"
    options:
      cwd: "./frontend"

    install:

      - name: 'deps'
        command: 'yarn'
        args:
          - "install"
        options:
          cwd: "./frontend"

There are two top level params:

  • version - for the time being, always "exp" to indicate that this is still an in-flux config file format
  • commands - a list of commands that mr-manager should run

Each command has the following format:

  • name - a human-readable name for the command
  • command - the command to run
  • args - a list of arguments to pass to the command
  • options - a map of options for running the command, passed directly to node's child_process.spawn method
  • watch - can be a string, an array or a map with the keys paths and options. used as arguments to chokidar for autoreloading a command. this is only needed if your command doesn't have some built-in way of auto-reloading
  • building - a list of regexes to match against to determine when your process is building
  • ready - a list of regexes to match against to determine when your process has built successfully and is ready
  • failed - a list of regexes to match against to determine when your process has failed to build
  • install - a list of commands to run prior to running the parent command, only occurs on the initial run and does not retrigger on subsequent refreshes, usually handles installing dependencies or any other setup, these have the same format and parameters as a top level command

Gotchas

By default, the watch option will ignore node_modules directories since including them can cause heavy CPU usage when starting the watcher. There currently isn't a way to disable this outside of altering the code yourself.

ready/building/failed are always interpreted as regexes. Make sure to include escape characters in them if you need to.