Skip to content

Instantly share code, notes, and snippets.

@rmarscher
rmarscher / uglify-watch.js
Created June 23, 2012 14:59 — forked from makeusabrew/1) uglify.js
Watch a specified directory's JavaScript files and recompile a specified output file if any changes are detected
/**
* Sample usage - note that the trailing slash on the watch directory is important!
*
* node uglify.js /path/to/my/src/directory/ /path/to/my/output/file.js
*/
var jsp = require('uglify-js').parser,
pro = require('uglify-js').uglify,
fs = require('fs');