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

runmon

v0.2.2

Published

Run a script and take further actions based on that script's output.

Downloads

4

Readme

runmon

Run a command and perform tasks based on that command's output.

This is a Node.js CLI tool for running a command, monitoring its output, and then running one or more other tasks every time a line of the command's output matches a pattern.

Installation

npm install runmon --save-dev

Usage

runmon [options] <command> <pattern> <task> [<task> ...]

Runs <command>, and when <pattern> appears in a line of the command's stdout, runs the <task>(s).

options:
	--startup-match-timeout=<milliseconds>
		Run the task(s) if <milliseconds> from command startup elapses with no output matching the pattern.

NOTES: The pattern can be a regular expression, e.g. "matchme$" matches only on a line where "matchme" is at the end. Pattern matching is performed on a line-by-line basis; consequently, you cannot match text across lines. The tasks are run every time a line of stdout matches the pattern; however, if a task is already running, another instance of that task is NOT started.

Example

To start nodemon after 'tsc -w' is done compiling (assumes you have a script labeled nodemon):

In your package.json scripts section:

"dev": "runmon \"tsc -w\" \"Found 0 errors.\" \"npm run nodemon\""

Release History

  • 0.2.2
    • Corrected version number in package-lock.json. Minor tweak to head comment in index.js.
  • 0.2.1
    • Fixed issue with premature termination of the primary task. Minor refactoring to address cross-platform testing issues.
  • 0.2.0
    • Changed --startup-match-timeout option to be of the form option=value. Added tests to the module. Other minor refactorings.
  • 0.1.0
    • Initial release

Why

The motivation for creating this tool came out of my search for a reliable cross-platform way to order the execution of tasks around the Typescript compiler running in watch mode (tsc -w). Specifically, I wanted to ensure I could run tasks after, and only after, the compiler finished compiling. There are, no doubt, other ways to solve this problem, but I wanted something simple that didn't add too much to a project's dev dependencies.

For reference: https://github.com/Microsoft/TypeScript/issues/12996

Meta

Dan Ziegelbein – [email protected]

Distributed under the ISC license. See LICENSE for more information.

https://github.com/dziegelbein/runmon