8000 GitHub - litek/gulp-bg: Spawn a process in the background · GitHub
[go: up one dir, main page]

Skip to content
litekPublic

About

Spawn a process in the background

Resources

Stars

14 stars

Watchers

1 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

gulp-bg

Execute command to run in the background. Calling the returned function restarts the process if it's already running.

Usage

Run a process in the background, and restart on changes.

var bg = require("gulp-bg");

let bgtask;
gulp.task("server", bgtask = bg("node", "--harmony", "server.js"));

const exitCallback = (proc) => { if (proc.errorcode != 0) { process.exit(proc.errorcode); } };

gulp.task("stop", () => {
    bgtask.setCallback(exitCallback);
    bgtask.stop();
  }
});

gulp.task("default", ["server"], function() {
  gulp.watch(["server.js"], ["server"]);
});

License

MIT

About

Spawn a process in the background

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0