# happytracks

> A minimal child process manager for node.

Latest version **1.0.1** (published 2018-02-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install happytracks
pnpm add happytracks
yarn add happytracks
bun add happytracks
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-02-20 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Pete Saia |
| Maintainers | lev-interactive |
| Keywords | child, processes, concurrency, cli |

## Links

- npm: https://www.npmjs.com/package/happytracks
- Repository: https://github.com/LevInteractive/happytracks
- Homepage: https://github.com/LevInteractive/happytracks#readme
- Issues: https://github.com/LevInteractive/happytracks/issues
- npm.io page: https://npm.io/package/happytracks

## Dependencies (1)

- [colors](https://npm.io/package/colors.md) ^1.1.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-02-20
- 1.0.0 — 2018-02-20

## README

# Happy Tracks

Make efficient CLI runners without all the bloat and dependency hell.

Basically, this will group the output of multiple processes by name so you can
better read it in your terminal. Output can be difficult to read when you have
multiple concurrent scripts running and this aims to solve that problem.

### Installation

```
npm i happytracks
```

### Use

There's only one method: `track(name, childProcess)`

```javascript
happy.track("compile-js", spawn("./build-js", []));
happy.track("compile-styles", spawn("./build-css", []));
```

For convenience, you may also run them synchronously.

```javascript
await happy.track("compile-js", spawn("./build-js", []));
await happy.track("compile-styles", spawn("./build-css", []));
```

### Real life example

```javascript
const spawn = require("child_process").spawn;
const happy = require("happytracks");

happy.track(
  "server",
  spawn(
    "nodemon",
    [
      "-V",
      "-x",
      "node --harmony --use_strict",
      "--watch",
      `${ROOT_DIR}/src/server/`,
      "--ignore",
      "schema.json",
      "--ignore",
      "public/",
      `${ROOT_DIR}/src/server/bin/www`
    ],
    {
      env: Object.assign({}, {
        NODE_ENV: env,
        DEBUG: "app:*",
        NODE_PATH: `${ROOT_DIR}/src/server`,
        NODE_CONFIG_DIR: `${ROOT_DIR}/src/server/config`,
        PORT: 3000
      }, process.env)
    }
  )
);

happy.track(
  "build-css",
  spawn(
    "nodemon",
    [
      path.join(__dirname, "/build-css"),
      "-x",
      "node --harmony",
      "-e",
      "styl",
      "--watch",
      `${ROOT_DIR}/src/client/stylus/`
    ],
    {
      env: Object.assign({}, process.env, {
        CLIENT_PATH: `${ROOT_DIR}/src/client`,
        SERVER_PATH: `${ROOT_DIR}/src/server`
      })
    }
  )
);

happy.track(
  "build-js",
  spawn(path.join(__dirname, "/build-js"), [], {
    env: Object.assign(
      {},
      {
        CLIENT_PATH: `${ROOT_DIR}/src/client`,
        SERVER_PATH: `${ROOT_DIR}/src/server`
      },
      process.env
    )
  })
);
```

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