Skip to main content

deno module deno compatibility

🎯 dkill

kill processes identified by port in Deno 🦕

CLI Usage

Install

deno install -f --unstable --allow-run --allow-net https://deno.land/x/dkill@0.7.0/cli.ts

You can then use it using command dkill

$ dkill --help

Usage:   dkill <targets...>
  Version: v0.0.1

  Description:

    Kill any processes by
      - port: Prefix port number by a colon. ex: 'dkill :3000'
      - pid: A valid integer. ex: 'dkill 12654'
      - process name: A string ex: 'dkill Code.exe'

        You can specify multiple targets at once. ex: 'dkill :5000 :3000 164'

  Options:

    -h, --help     - Show this help.
    -V, --version  - Show the version number for this program.
    -v, --verbose  - Increase verbosity
    -d, --dryrun   - Dry run, List the pids that would have been killed. Does not kill anything

Programatic Usage

mod.ts exports multiple functions that can be used programmatically. Check source code for more info

See docs

Support

Windows

On windows, to retrieve the command line, Powershell is used, which requires windows 8 or above.

Linux

On linux the cmd ss is used, which works on ubuntu 16.04 and above.

Mac

Not implemented. PR welcome.

  • port
  • pid
  • process

TODOs

  • on windows check if powershell is present.
  • on linux check if ss is present.
  • improve docs for submodule

Inspiration