# waitpid2

> Complete native binding to the waitpid() syscall

Latest version **2.0.5** (published 2017-03-15) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.5 |
| Published | 2017-03-15 |
| First published | 2016-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | joshiggins |
| Maintainers | joshiggins |
| Keywords | waitpid, child process |

## Links

- npm: https://www.npmjs.com/package/waitpid2
- Repository: https://github.com/joshiggins/node-waitpid2
- Homepage: https://github.com/joshiggins/node-waitpid2#readme
- Issues: https://github.com/joshiggins/node-waitpid2/issues
- npm.io page: https://npm.io/package/waitpid2

## Dependencies (1)

- [node-pre-gyp](https://npm.io/package/node-pre-gyp.md) ^0.6.33

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.5 (latest) — 2017-03-15
- 2.0.4 — 2017-03-15
- 2.0.3 — 2017-03-01
- 2.0.2 — 2017-03-01
- 2.0.1 — 2017-03-01
- 2.0.0 — 2017-03-01
- 1.0.0 — 2016-01-25

## README

# node-waitpid2

Originally forked from AvianFlu/node-waitpid changing the behaviour to be more like nature intended.

The `waitpid` syscall is used to [wait for a process to change state](https://linux.die.net/man/2/waitpid).

For terminated child processes, waiting for them releases the resources associated with the child in the process table. If you don't do this, they could remain zombies for ever!

You should implement a blocking loop in your application in order to wait for a child process. You should do this asyncronously by passing `WNOHANG` as an option and using a timeout to call `waitpid` until the PID returned is `0` (no child process state changes left). Don't let the `waitpid` call block the whole thread.

Starting from version 2.0.0 fixed to use the latest node addon/v8 API.

## building binary

If a binary is available it will be installed using `node-pre-gyp`. Binaries are hosted in this repository releases page. The process of building and uploading is as follows:

```
export NODE_PRE_GYP_GITHUB_TOKEN=<token>
./node_modules/node-pre-gyp/bin/node-pre-gyp configure
./node_modules/node-pre-gyp/bin/node-pre-gyp build
./node_modules/node-pre-gyp/bin/node-pre-gyp package
./node_modules/node-pre-gyp-github/bin/node-pre-gyp-github.js publish
```

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