npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ibrahimgunduz34/process-list

v1.0.13

Published

It's a library that simply wrap the ps command in order to access the active process list from your application.

Downloads

40

Readme

Npm Publish Workflow

ProcessList

It's a library that simply wrap the ps command in order to access the active process list from your application.

Installation:

$ npm install @ibrahimgunduz34/process-list

Reference:

| Method | Description | |----------------------------------------|-----------------------------------| | getList(asArray, options): Promise<[]> | Returns list of running processes |

getList(asArray, options): Promise<[]>:

Parameters:

| Parameter | Type | Required | Default | Description | |------------|----------|----------|---------------|-----------------------------------| | asArray | boolean | No | false | It allows the method to return the running processes as an array. The first item of the array would be the column list. By default, it takes false value and the method would returns the running processes as a list of objects that contains the process details with their column names. | | options | array | No | ['a','u','x'] | It allows passing extra arguments to the ps command. |

Return:

It returns a Promise with the list of running processes as objects or arrays.

Usage:

const ProcessList = require('process-list');

// ...

const processes = await ProcessList.getList();
/**
  [
    {
      USER: 'root',
      PID: '6029',
      '%CPU': '0.0',
      '%MEM': '0.0',
      VSZ: '0',
      RSS: '0',
      TTY: '?',
      STAT: 'I',
      START: '09:56',
      TIME: '0:00',
      COMMAND: '[kworker/u4:2-events_unbound]'
    },
    {
      USER: 'root',
      PID: '6036',
      '%CPU': '0.0',
      '%MEM': '0.0',
      VSZ: '0',
      RSS: '0',
      TTY: '?',
      STAT: 'I',
      START: '09:56',
      TIME: '0:00',
      COMMAND: '[kworker/0:2-events]'
    },
    {
      USER: 'vagrant',
      PID: '6385',
      '%CPU': '0.0',
      '%MEM': '3.2',
      VSZ: '512544',
      RSS: '32736',
      TTY: 'pts/0',
      STAT: 'Rl+',
      START: '10:03',
      TIME: '0:00',
      COMMAND: 'node src/ntop.js'
    }
  ]
*/ 

//...

const processes = await ProcessList.getList({asArray: true});
/**
  [
    [
      'USER',
      'PID',
      '%CPU',
      '%MEM',
      'VSZ',
      'RSS',
      'TTY',
      'STAT',
      'START',
      'TIME',
      'COMMAND'
    ],
    [
      'root',
      '6029',
      '0.0',
      '0.0',
      '0',
      '0',
      '?',
      'I',
      '09:56',
      '0:00',
      '[kworker/u4:2-events_unbound]'
    ],
    [
      'root',
      '6036',
      '0.0',
      '0.0',
      '0',
      '0',
      '?',
      'I',
      '09:56',
      '0:00',
      '[kworker/0:2-events]'
    ],
    [
      'vagrant',
      '6385',
      '0.0',
      '3.2',
      '512544',
      '32736',
      'pts/0',
      'Rl+',
      '10:03',
      '0:00',
      'node src/ntop.js'
    ]
  ]
 */