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

  1. /**
  2. * Watch for changes in the sourcecode, and rebuild vis.js on change
  3. *
  4. * Usage:
  5. * cd vis
  6. * node tools/watch.js
  7. */
  8. var watch = require('node-watch'),
  9. child_process = require('child_process');
  10. // constants
  11. var WATCH_FOLDER = './src';
  12. var BUILD_COMMAND = 'jake build';
  13. // rebuilt vis.js on change of code
  14. function rebuild() {
  15. var start = +new Date();
  16. child_process.exec(BUILD_COMMAND, function () {
  17. var end = +new Date();
  18. console.log('rebuilt in ' + (end - start) + ' ms');
  19. });
  20. }
  21. // watch for changes in the code, rebuilt vis.js automatically
  22. watch(WATCH_FOLDER, function(filename) {
  23. console.log(filename + ' changed');
  24. rebuild();
  25. });
  26. rebuild();
  27. console.log('watching for changes in the source code...');