vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
765 B

/**
* Watch for changes in the sourcecode, and rebuild vis.js on change
*
* Usage:
* cd vis
* node tools/watch.js
*/
var watch = require('node-watch'),
child_process = require('child_process');
// constants
var WATCH_FOLDER = './src';
var BUILD_COMMAND = 'jake build';
// rebuilt vis.js on change of code
function rebuild() {
var start = +new Date();
child_process.exec(BUILD_COMMAND, function () {
var end = +new Date();
console.log('rebuilt in ' + (end - start) + ' ms');
});
}
// watch for changes in the code, rebuilt vis.js automatically
watch(WATCH_FOLDER, function(filename) {
console.log(filename + ' changed');
rebuild();
});
rebuild();
console.log('watching for changes in the source code...');