Intelligently and continuously auto execute tasks on file/directory changes. Language, framework and library agnostic.
watchn aims to automate the repetitive tasks developers run throughout the day. Tasks such as running tests, generating documentation, concatenating and minifying files. You know all those tasks we hammer together inside a Makefile
, Rakefile
, Cakefile
, Jakefile
or even Ant
(cringe) tasks. In fact hooking into these files is exactly what it's designed for. watchn is really an elaborate file/directory watcher and directs it's notifications into callbacks defined by the user. watchn is built to run in the background so you can write your code and don't have to leave your current window to run the build scripts or tests. watchn can be as quiet or as loud as you want it to be. It's really up to the user to define what your preference is and what watchn executes on.
watchn can associate a file change in a single directory and execute multiple tasks. Say you code your application in CoffeeScript and it's stored in lib/src
and say you've put a couple of watchers on the lib
directory for compiling CoffeeScript, running your tests, generating documentation and concatenating and minifying the output. Saving a CoffeeScript file will trigger all of these tasks and you can get immediate feedback on the status of their results.
watchn also does some fancy code reloading, so it knows when you add a file/directory, remove a file/directory, or even update the runner file you've setup to hook into your tasks.
Why use this over the built in watchers that come with most libraries? Generally if you are using various libraries together (say, SCSS, CoffeeScript, Jasmine, etc..) you most likely would have numerous watcher's activated, generating various output in multiple windows or background tasks. watchn combines these into one single watcher and is ready to yell at you if you get it wrong or pat you on the back when your tasks run successfully.
npm install watchn -g cd workspace/project watchn runner .watchn watchn .watchn
See the project readme for full details.
See the annotated source for more information about watchn's javascript files: