# ezspawn

> Spawn a process with ease.

Latest version **1.1.0** (published 2015-09-20) · ISC license · 0 weekly downloads

> **Better alternative:** See documentation for alternatives (https://github.com/AikidoSec/module-replacements/blob/main/docs/process-exec)

## Install

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

## 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.1.0 |
| Published | 2015-09-20 |
| First published | 2015-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michael Leaney |
| Maintainers | leahcimic |
| Keywords | spawn, child_process, process, exec |

## Links

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

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.10.0
- [cli-command-parser](https://npm.io/package/cli-command-parser.md) ^1.0.2

## Recent versions

- 1.1.0 (latest) — 2015-09-20
- 1.0.3 — 2015-09-15
- 1.0.2 — 2015-09-11
- 1.0.1 — 2015-09-11
- 1.0.0 — 2015-09-11

## README

# ezspawn [![Build Status](https://travis-ci.org/leahciMic/ezspawn.svg?branch=master)](https://travis-ci.org/leahciMic/ezspawn)

Spawn a process with ease.

## Install

```sh
npm install --save ezspawn
```

## Usage

```js
var ezspawn = require('ezspawn');

ezspawn('ls -lh').then(function(output) {
  console.log(output);
});
```

## API

`ezspawn.spawn(cmd)`

Spawn a process and return the child_process object.

`ezspawn(cmd, timeout=60000)`

Runs `cmd`, and returns a promise with the results.

### `cmd`

The command you wish to execute. It uses
[cli-command-parser](https://www.npmjs.com/package/cli-command-parser) to parse
the string into a suitable format for `child_process#spawn`.

### `waitForProcess`

When true, ezspawn will capture stdout, stderr and wait for the process to
terminate. The returned promise will be resolved to an object containing the
following:

```js
{
  code: exitCode,
  stdout: stdoutBuffer,
  stderr: stderrBuffer
};
```

When false, the promise will be resolved with the return value of
`child_process#spawn`.

Default: `true`

### `timeout`

Specifies how long we should wait for the process in milliseconds before timing
out.

Default: 60 seconds

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