node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



Run pending scripts (services) in a child_process and talk to them (and kill those bastards)

How to use Forrest

import Forrest from 'forrest';

// run a simple command that exits by itself'ls').then(output => console.log(output));

// run a service and do soemthing when ready
var service =, {
	service: './my-server.js',
	expect: /listening on 3000/g,

// do something when the service is ready
service.then(() => console.log('MyServer is ready!'));

// do something else if the service fails
service.catch(err) => console.log('Error', err));






some services send logs to stderr, strange but true!



listen to stderr and fail the promise if anything is sent here.





gracefully stop the service, sends in a SIGTERM and return a Promise.


hard kill

Folder Structure


Write here your ES6 source files.


Write here your ES6 unit tests.


This is the target folder for ES5 transpiled files.

(ES6)          (ES5)
/src/foo.js -> /lib/foo.js


This is the target folder for the test coverage report.

Provided Scripts

There are a couple of NPM scripts which make your developer life easier:

npm run build

It transpiles /src into ES5 compatible files in /lib.

npm run build:watch

It transpiles and monitor /src files for new changes.

npm lint

It checks your code for any possible problem or style errors accordingly to .eslintrc.

npm clean

It removes all the generated files in /lib and /coverage.

npm test

npm run test:watch

npm run test:cov

It runs the tests and produces a test coverage report in /coverage.