Skip to content

itsliamegan/watch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watch
=====

Recursively poll a directory for file changes.

Usage - CLI
-----------

	$ watch      # poll the current directory
	$ watch src/ # poll the "src/" directory

Usage - Go
-----------

	package main

	import (
		"fmt"
		"os"

		"github.com/itsliamegan/watch"
	)

	func main() {
		changes, errs := watch.Start("src/")

		for {
			select {
			case change := <-changes:
				fmt.Println(change)
			case err := <-errs:
				fmt.Fprintln(os.Stderr, err)
				os.Exit(1)
			}
		}
	}

About

Recursively poll a directory for file changes

Resources

Stars

Watchers

Forks