litek / gulp-bg Goto Github PK
View Code? Open in Web Editor NEWSpawn a process in the background
License: MIT License
Spawn a process in the background
License: MIT License
There's 0.0.8 version on npmjs.org. Please publish new version.
Following is the script that I am using to live reload the gulpfile.js. default task will start a new background process gulp bootstrap
which in turn starts another background process called node app/start.js
. The initial run works as intended. But once I edit gulpfile.js it triggers a watch inside default and kills existing gulp bootstrap
process and starts new gulp bootstrap
. But the problem is previous instance of node app/start.js
process is still running. Because previous instance of node server is not killed and it's still listens on the same port I get an error EADDRINUSE when I ever I edit gulpfile.js. Is there any way to automatically kill child process node app/start.js
of gulp bootstrap
when ever new gulp bootstrap
process is launched ?
var gulp = require('gulp');
var watch = require('gulp-watch');
var bg = require('gulp-bg');
gulp.task('start_server', bg("node", "app/start.js"));
gulp.task('bootstrap', ['start_server'], function() {
watch("app/**/*", function(){
gulp.start('start_server');
});
});
gulp.task('spawn_bootstrap', bg("gulp", "bootstrap"));
gulp.task('default', function(){
watch('gulpfile.js', function() {
gulp.start('spawn_bootstrap');
});
gulp.start('spawn_bootstrap');
});
Hi!
I am using this plugin to run PhantomJS webdriver for my tests. I would like to kill the process when the tests are done. Is this possible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.