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

onemon

v1.2.4

Published

Run a npm script as a deamon, once

Downloads

198

Readme

Welcome to onemon 👋

Version License: MIT

A CLI to help you share a deamon between your scripts

onemon has been created to fill a gap in the complex tooling world of javascript. When you have a monorepo, you may want to share a watcher between all your processes.

Of course you can do this by creating a vscode task like one that will launch tsc --watch in the background but maybe you want something more generic: a task that will launch both an instance of the watcher and your process in the same process.

The problem is if you launch two tasks, you don't want two watchers, so here onemon will help you, it will launch only one deamon and share it between your processes by using sockets to output its stdout.

Install

yarn global add onemon

Usage

onemon [deamon-script] <script>

How it works?

The only deamon

  • onemon starts your deamon-script .js as a deamon, if it's not already started.
  • onemon attach to a socket opened by the deamon, so you can watch your deamon output.
  • onemon starts your script if you provided one.
  • when no script using onemon deamon-script ... is running, onemon kills your one deamon.

What can be scripts?

  • For the deamon, you can only use a .js file path.
  • For the script, you can either use a .js file path, or a script entry from the nearest package.json

Flags

| name | shortcut | description | | ------------- | ------------- | ------------- | | silent | -s | Don't attach to the deamon output. | | wait | -w | Wait for the deamon to call notifyReady() before launching the script. |

Using it programmatically

  • The main function is exported so instead of using the CLI you can use onemon in your own code programmatically and we encourage you to do this.
  • A notifyReady function is exported that you can use on your deamon so it notifies onemon that an event happened, like a succeed built.

Can I test it?

  • clone the repository
  • execute yarn install, yarn build and yarn link or install onemon globally from the npm registry.
  • execute onemon examples/deamon.js on one terminal
  • execute onemon examples/deamon.js script on another terminal
  • play with the flags and use more terminals

Author

👤 Paul Le Couteur