Last active
August 30, 2015 15:21
-
-
Save electblake/6208e916ec78d07f09ed to your computer and use it in GitHub Desktop.
gulp nodemon and bunyan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // borrowed initial version from https://github.com/JacksonGariety/gulp-nodemon/issues/33 | |
| gulp.task('run', ['default', 'watch'], function() { | |
| var nodemon = require('gulp-nodemon'), | |
| spawn = require('child_process').spawn, | |
| bunyan = require('bunyan'); | |
| nodemon({ | |
| script: paths.server, | |
| ext: 'js json', | |
| ignore: [ | |
| 'var/', | |
| 'node_modules/' | |
| ], | |
| watch: [paths.etc, paths.src], | |
| stdout: false, | |
| readable: false | |
| }) | |
| .on('change', ['lint']) | |
| .on('readable', function() { | |
| // free memory | |
| // bunyan && bunyan.kill() | |
| bunyan = spawn('./node_modules/bunyan/bin/bunyan', [ | |
| '--output', 'short', | |
| '--color' | |
| ]) | |
| bunyan.stdout.pipe(process.stdout) | |
| bunyan.stderr.pipe(process.stderr) | |
| this.stdout.pipe(bunyan.stdin) | |
| this.stderr.pipe(bunyan.stdin) | |
| }); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment