Socket
Socket
Sign inDemoInstall

ps-man

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ps-man

Manage process (list/kill)


Version published
Weekly downloads
229
decreased by-18.51%
Maintainers
1
Install size
7.41 kB
Created
Weekly downloads
 

Readme

Source

ps-man pipeline status

To install:

npm install --save ps-man

Usage

  • list
    • name : Process name - optional
    • pid : Process identifier - optional
    • clean : boolean to return clean list for mac - optional
  • kill
    • pidList : Array of process identifier - mandatory
    • signal : The default signal for kill is TERM. (see man ps) - optional - OSX/Linux only

List processes

Filter by name
var ps = require('ps-man');

// Filter by name
var options = {
  name: 'node'
};

ps.list(options, function(err, result) {
  // my stuff here
});
Filter by pid
var ps = require('ps-man');

// Filter by pid
var options = {
  pid: 1501
};

ps.list(options, function(err, result) {
  // my stuff here
});
Return a cleaned list for OSX/Linux
var ps = require('ps-man');

// Filter by pid
var options = {
  clean: true
};

ps.list(options, function(err, result) {
  // my stuff here
});

Kill processes

var ps = require('ps-man');

var options = {
  pidList: ['1501'],
  signal: '-9'
};

ps.kill(options, function(err) {
  // stuff here
});

// or could be used as following
ps.kill(['1501'], function(err) {
  // stuff here
});

License

MIT. Please see License file for more details.

Keywords

FAQs

Last updated on 05 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc