# qiao-process

> nodejs process tool

Latest version **5.0.0** (published 2025-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install qiao-process
pnpm add qiao-process
yarn add qiao-process
bun add qiao-process
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-07-25 |
| First published | 2022-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | uikoo9 <uikoo9@qq.com> |
| Maintainers | npm_insistime |
| Keywords | nodejs, process, child_process, fork |

## Links

- npm: https://www.npmjs.com/package/qiao-process
- Repository: https://github.com/uikoo9/qiao-nodejs
- Homepage: https://code.vincentqiao.com/#qiao-process
- Issues: https://github.com/uikoo9/qiao-nodejs/issues
- npm.io page: https://npm.io/package/qiao-process

## Recent versions

- 5.0.0 (latest) — 2025-07-25
- 4.7.2 — 2024-12-04
- 4.5.1 — 2024-03-07
- 4.4.2 — 2024-02-17
- 4.3.0 — 2023-11-15
- 4.2.6 — 2023-11-14
- 4.1.1 — 2023-10-09
- 4.0.0 — 2023-10-05
- 3.4.7 — 2023-09-08
- 3.2.7 — 2023-05-03
- 3.1.5 — 2023-04-14
- 3.1.2 — 2023-04-13
- 3.1.1 — 2023-04-08
- 0.0.9 — 2022-11-30
- 0.0.8 — 2022-11-30
- … 6 more at https://npm.io/package/qiao-process/versions

## README

## qiao-process

[![npm version](https://img.shields.io/npm/v/qiao-process.svg?style=flat-square)](https://www.npmjs.org/package/qiao-process)
[![npm downloads](https://img.shields.io/npm/dm/qiao-process.svg?style=flat-square)](https://npm-stat.com/charts.html?package=qiao-process)

nodejs 下 process 能力

## install

安装

```shell
npm i qiao-process
```

## use

使用

```javascript
// cjs
const { fork } = require('qiao-process');

// mjs
import { fork } from 'qiao-process';
```

## api

### fork & kill

```javascript
// path
const path = require('path');

// q
const { fork, kill } = require('qiao-process');

// test
function test() {
  const jsPath = path.resolve(__dirname, './cp.js');
  const args = ['haha'];

  const cp = fork(
    jsPath,
    args,
    function (msg) {
      console.log(`from child process: ${msg}`);
    },
    function (code) {
      console.log(`exit code: ${code}`);
    },
  );

  cp.send('hello child process');

  // kill cp
  setTimeout(function () {
    kill(cp.pid);
  }, 3000);
}

test();
```

### onMsg & send

```javascript
// qiao
const { onMsg, send } = require('qiao-process');

onMsg(function (msg) {
  console.log(`from main process: ${msg}`);
});

send('hello main process');
```

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