JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 920
  • Score
    100M100P100Q106592F
  • License MIT

Manage process (list/kill)

Package Exports

  • ps-man

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ps-man) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.