GitXplorerGitXplorer
m

monty

public
6 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
041d6ebb0f8b4971e62112b132e4a69a90ab0f89

Properly shut down when chromedb fails

mmightyguava committed 7 years ago
Unverified
fcb5fa39818c632c3936f83021a8ff234f984a55

Logging tweaks

mmightyguava committed 7 years ago
Unverified
53d6ae5965a1c80b7bd73eb5e4253326eb8eb4ba

Chrome waits for server to be available before refresh

mmightyguava committed 7 years ago
Unverified
c79e9f768ac87612314a814d8bc616644d0f2bd9

Change rate limit to per second

mmightyguava committed 7 years ago
Unverified
cb7e25dd0da5cd03bfecaef83df9b9aac31c8ee3

Add throttling

mmightyguava committed 7 years ago
Unverified
2329d45c3c69c6c46faa3f0c233fd4c80f69d6fc

rename to monty, because monty python

mmightyguava committed 7 years ago

README

The README file for this repository.

monty

monty is a tool for doing something when files change. It can do one of 2 things, or both:

  • Re-run a command (or restart a web server) kind of like nodemon, chokidar, and reflex
  • Launch Chrome and reload the page as needed, kind of like livereload, but with no setup required!

monty is ridiculously simple. The whole thing could just be a bash script around inotifywait, but a bash script just isn't as cool as a Go tool 🔥 🔥 🔥

Installation

go get -u github.com/mightyguava/monty

Usage

Restart a command or web server

monty echo hello world
monty java Main.java
monty go run main.go
monty python -m SimpleHTTPServer

Now monty will watch for any file changes within your current directory and subdirectories, and keep saying "hello world" every time something changes.

Live reload a Chrome tab

monty -url www.google.com

Quirik: Chrome opens in the background in a new window. You'll have to manually switch to it. I haven't figured out how to make it open in the foreground https://github.com/chromedp/chromedp/issues/171.i

Restart a web server AND live reload a Chrome tab

monty -url localhost:8000 npm start

Bash script

You can run a whole bash script. It's ok that your script exits. monty will restart it whenever you change something.

monty sh -c 'echo hello; echo world; echo i can chain forever'
monty sh -c my_super_awesome_script.sh

How it works

monty uses notify to watch the current directory for changes, and restart the command if anything changed. It doesn't care about what language your code is written in, just that you give it a command that can be executed on *nix.

monty uses chromedp to control a Chrome window, reloading it when a file changes.

Similar tools