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

rainbowd

v0.4.0

Published

Painless zero-downtime redeploys for simple apps.

Downloads

8

Readme

rainbowd.js

Painless zero-downtime redeploys for simple apps.

rainbowd.js is a small reverse proxy. You tell it how to launch your app on a given port and with a given pidfile, and it will handle gracefully moving traffic to a new process and killing the old one when it comes time to redeploy. This is still in alpha stages, so proceed at your own risk!

The graceful shutdown is enitrely dependent on the underlying webserver providing a graceful shutdown.

No current plans to support websockets.

Written with node-http-proxy.

Usage

Provide:

  • A command that takes a server port and launches the current release on that port
  • Either:
    • A healthcheck url (suggested)
    • A warmup time (careful! Setting this too low could cause downtime)

Get back:

  • A proxy of your app on 0.0.0.0:7000
  • Zero downtime deploys by doing curl -d '' 127.0.0.1:7001/redeploy (note this only listens on the loopback address).
    • Note that this API is will change soon. The rest API will gain some type of security token, and the default will be to disallow API redeploys and use something else file-based so it's easier to restrict by Linux users and groups.

It will launch the service on a new available port, only send new connections to the new service, and send SIGTERM to the old service, which hopefully will trigger a graceful shutdown.

This is intended to run beind another reverse proxy. The idea is if you're already pointing e.g. Apache or Nginx to your app server, you point them to rainbowd.js instead.

This is a lightweight blue-green deploy system. But it's not limited to just two concurrent versions: supposing the responses are slow and/or the deploys happen fast enough, it can keep an arbitrary number (well, up to a hard limit of 10) running. This is where the name comes from.

TODO

  • [ ] Test with various Python and Ruby servers.
  • [ ] Command-line flag for config file
  • [ ] Allow control and server port/addr to be configurable
  • [ ] Allow a touch file(?) for redeploy to make redeploy easier/more secure
  • [ ] Option to disable REST API