0.1.0 • Published 4 years ago

gulp-spawner v0.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

gulp-spawner

This is a little tool to create shallow wrappers around Nodes ChildProcess. Its purpose is to be an idiomatic way of launching and killing processes. While it provides some support for I/O, there are gulp-plugins with that in mind which are probably more suited for this ( gulp-spawn, gulp-run). The motivation behind this tool was to have an easy way of spawning and killing things like a webserver or a database daemon for testing. It's clearly geared towards gulp (providing some methods returning a Vinyl instance) and building/testing automation, not towards production use.

Usage

const spawner = require("spawner");
spawner.register("mongod", () => {
  spawner.sys("mongod", ["--dbpath", "data"]);
});
const mongod = spawner.mongod();
/* run stuff, e.g. tests that require mongod to be running */
mongod.sig.kill();

Test coverage

  • statements: 90%
  • branches: 64%
  • functions: 86%
  • lines: 94%

TODOs

[] uniform API for spawner.{sys,shx,npx} [] fix all TODOs/FIXMEs [] >95% test coverage [] typescript migration?