GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alloc/tree-kill: Fork of node-tree-kill

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
examples
examples
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 
tsdown.config.ts
tsdown.config.ts
 
 

Repository files navigation

@alloc/tree-kill

Purpose

@alloc/tree-kill kills a spawned process and its descendants across macOS, Linux, and Windows.

It is a rewrite of the original tree-kill package that preserves the same OS-specific traversal strategy but changes the public API to a ProcessLike interface with separate async and sync entrypoints instead of a raw pid plus callback.

Installation

pnpm add @alloc/tree-kill

Quick Example

import { spawn } from "node:child_process";
import treeKill from "@alloc/tree-kill";

const child = spawn(process.execPath, ["-e", "setInterval(() => {}, 1000)"], {
  stdio: "ignore",
});

await treeKill(child, "SIGTERM");

Exit-Time Fallback

Use the synchronous export only in shutdown paths where async work cannot be awaited reliably, such as process.on("exit"):

import { spawn } from "node:child_process";
import treeKill, { treeKillSync } from "@alloc/tree-kill";

const child = spawn(process.execPath, ["-e", "setInterval(() => {}, 1000)"], {
  stdio: "ignore",
});

await treeKill(child, "SIGTERM");

process.on("exit", () => {
  treeKillSync(child, "SIGTERM");
});

Documentation Map

  • Conceptual behavior, platform notes, and rewrite boundaries: docs/context.md
  • Runnable repository example: examples/basic-usage.ts
  • Exact exported signatures: run pnpm build and inspect dist/index.d.mts

About

Fork of node-tree-kill

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.