Commit 978c0e1
Changed files (4)
docs/process-promise.md
@@ -255,6 +255,13 @@ setTimeout(() => p.kill('SIGINT'), 100)
await p
```
+Killing the expired process raises an error:
+
+```js
+const p = await $`sleep 999`
+p.kill() // Error: Too late to kill the process.
+```
+
## `abort()`
Terminates the process via an `AbortController` signal.
@@ -278,6 +285,16 @@ const res = fetch('https://example.com', {signal})
p.abort('reason')
```
+The process may be aborted while executing, the method raises an error otherwise:
+
+```js
+const p = $({nothrow: true})`sleep 999`
+p.abort() // ok
+
+await p
+p.abort() // Error: Too late to abort the process.
+```
+
## `stdio()`
Specifies a standard input-output for the process.
test/smoke/win32.test.js
@@ -69,9 +69,6 @@ _describe('win32', () => {
test('ps detects self process', async () => {
const [root] = await ps.lookup({ pid: process.pid })
- console.log('process.pid:', process.pid)
- console.log('process list', JSON.stringify(await ps.lookup(), null, 2))
-
assert.equal(root.pid, process.pid)
})
package-lock.json
@@ -1,12 +1,12 @@
{
"name": "zx",
- "version": "8.6.3",
+ "version": "8.7.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "zx",
- "version": "8.6.3",
+ "version": "8.7.0",
"license": "Apache-2.0",
"bin": {
"zx": "build/cli.js"
package.json
@@ -1,6 +1,6 @@
{
"name": "zx",
- "version": "8.6.3",
+ "version": "8.7.0",
"description": "A tool for writing better scripts",
"type": "module",
"main": "./build/index.cjs",