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

flinch

v1.0.2

Published

Multitask with cat-like reflexes

Downloads

53

Readme

flinch

Multitask with cat-like reflexes

Build Status Coverage Status Dependency Status NPM version

Installation

npm install -g flinch

Features

Flinch provides an easy to use API for blocking and signaling on events. When you have multiple terminal sessions open and need to queue up long running commands, flinch comes to the rescue.

Organizing your code into several, small and reusable packages is great. Unfortunately, you may find yourself needing to build and run tasks in several repositories at once. When that happens, things can get difficult. Anyone who's tried to use Git submodules can testify to that.

Flinch exposes a few simple commands

  • flinch server spawns an HTTP server that acts as the mediator for event blocking and signaling
  • flinch on <event> will block until the specified event has fired
  • flinch at <event> will signal that the specified event has occurred, causing anything blocking on it to exit with a status code of 0
  • flinch gg <event> will signal that the specified event has failed, causing anything blocking on it to exit with a status code of 1
  • flinch flush will clear the list of events the server remembers having been fired at

By default, flinch at and flinch gg announcements have a TTL of 10 minutes, which helps to alleviate race condition concerns of flinch on not being run until after the event is flinched at. This time can be explicitly set via the --ttl flag.

Usage

Usage: flinch [options] [command]

Commands:

  server [options]       start a flinch server
  s                      alias for server command
  on <event>             block on the specified event
  at [options] <event>   announce that the specified event has occurred
  gg [options] <event>   announce that the specified event has failed
  flush                  clear list of announced events
  f                      alias for flush command

Options:

  -h, --help         output usage information
  -V, --version      output the version number
  -p, --port [port]  specify which port to use [Default: 3030]

Options for server command:

  -g, --growl      enable growl notifications

Options for gg and at commands:

  -t, --ttl [ttl]  set time to live for event success announcement in minutes

Contrived usage example

After starting flinch server, you may do something like this:

# Terminal 1
make clean && make && make test && flinch at model

# Terminal 2
make clean && flinch on model && make && flinch at worker

# Terminal 3
rake clean && flinch on model && ./some_script && flinch on worker && rake deploy

How it works

Flinch works by having an HTTP server running in the background that acts as a mediator between blockers and signalers. flinch on blockers will poll the server once per second for updates on the event they're waiting on. flinch at and flinch gg will send a POST request to the server to announce the event status. That's all there is to it.

License

MIT