New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

getpid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getpid

Get the pid of running processes on any platform

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
31
-18.42%
Maintainers
1
Weekly downloads
 
Created
Source

getpid

Cross-platform PID retrieval (by process name), using ps on OSX/Unix and ms-wmic on Windows.

npm i getpid --save

Usage

const getpid = require('getpid');

async function main() {
  try {
    // get all pids for "node" processes
    const pids = await getpid('node');
  } catch (err) {
    handle_error(err);
    return;
  }

  if (!pids.length) {
    return process_not_found();
  }

  for (const pid of pids) {
    await do_something_with_pid(pid);
  }
}

Keywords

get

FAQs

Package last updated on 20 Aug 2022

Did you know?

Socket

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