tree-kill

WebJar for tree-kill

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

tree-kill
Последняя версия

Последняя версия

1.2.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

tree-kill
WebJar for tree-kill
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/pkrumins/node-tree-kill

Скачать tree-kill

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/tree-kill/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>tree-kill</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/tree-kill/
implementation 'org.webjars.npm:tree-kill:1.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/tree-kill/
implementation ("org.webjars.npm:tree-kill:1.2.2")
'org.webjars.npm:tree-kill:jar:1.2.2'
<dependency org="org.webjars.npm" name="tree-kill" rev="1.2.2">
  <artifact name="tree-kill" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='tree-kill', version='1.2.2')
)
libraryDependencies += "org.webjars.npm" % "tree-kill" % "1.2.2"
[org.webjars.npm/tree-kill "1.2.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Tree Kill

Kill all processes in the process tree, including the root process.

Examples

Kill all the descendent processes of the process with pid 1, including the process with pid 1 itself:

var kill = require('tree-kill');
kill(1);

Send a signal other than SIGTERM.:

var kill = require('tree-kill');
kill(1, 'SIGKILL');

Run a callback when done killing the processes. Passes an error argument if there was an error.

var kill = require('tree-kill');
kill(1, 'SIGKILL', function(err) {
    // Do things
});

You can also install tree-kill globally and use it as a command:

tree-kill 1          # sends SIGTERM to process 1 and its descendents
tree-kill 1 SIGTERM  # same
tree-kill 1 SIGKILL  # sends KILL instead of TERMINATE

Methods

require('tree-kill')(pid, [signal], [callback]);

Sends signal signal to all children processes of the process with pid pid, including pid. Signal defaults to SIGTERM.

For Linux, this uses ps -o pid --no-headers --ppid PID to find the parent pids of PID.

For Darwin/OSX, this uses pgrep -P PID to find the parent pids of PID.

For Windows, this uses 'taskkill /pid PID /T /F' to kill the process tree. Note that on Windows, sending the different kinds of POSIX signals is not possible.

Install

With npm do:

npm install tree-kill

License

MIT

Changelog

[1.2.2] - 2019-12-11

Changed

  • security fix: sanitize pid parameter to fix arbitrary code execution vulnerability

[1.2.1] - 2018-11-05

Changed

  • added missing LICENSE file
  • updated TypeScript definitions

[1.2.0] - 2017-09-19

Added

  • TypeScript definitions

Changed

  • kill(pid, callback) works. Before you had to use kill(pid, signal, callback)

[1.1.0] - 2016-05-13

Added

  • A tree-kill CLI

[1.0.0] - 2015-09-17

Added

  • optional callback
  • Darwin support

Версии библиотеки

Версия
1.2.2