# gulp-bg

> Spawn a process in the background

Latest version **0.0.9** (published 2017-07-10) · 0 weekly downloads

## Install

```sh
npm install gulp-bg
pnpm add gulp-bg
yarn add gulp-bg
bun add gulp-bg
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2017-07-10 |
| First published | 2014-03-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | litek |
| Keywords | gulpplugin |

## Links

- npm: https://www.npmjs.com/package/gulp-bg
- Repository: https://github.com/litek/gulp-bg
- Issues: https://github.com/litek/gulp-bg/issues
- npm.io page: https://npm.io/package/gulp-bg

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ~0.4.0

## Recent versions

- 0.0.9 (latest) — 2017-07-10
- 0.0.8 — 2015-12-17
- 0.0.7 — 2015-07-27
- 0.0.5 — 2014-05-10
- 0.0.4 — 2014-04-14
- 0.0.3 — 2014-03-06
- 0.0.2 — 2014-03-06
- 0.0.1 — 2014-03-06

## README

# 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.

```javascript
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

---
_Source: https://npm.io/package/gulp-bg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
