pkrumins/node-tree-kill

Running tree kill with superuser via command interface

alicecodes opened this issue · 2 comments

Hi,

I have a use case where I need to run tree-kill with elevated user privileges to kill a parent and its child processes.

One way to get this use case to work with tree-kill is to call it from the command line like this:

sudo treeKill [pid]

Thanks!

Hi Alice,
That should be pretty easy. Assuming you have NodeJS installed on your path, this ought to work:

#! /usr/bin/env node
kill = require('tree-kill')
kill(process.argv[2])

I'll consider adding a CLI command to the tree-kill package so it's easier to install

I'm done considering, consider it done. Update to v1.1.0 and you'll have a CLI.
asciicast