Giter Site home page Giter Site logo

reklatsmasters / node-process-list Goto Github PK

View Code? Open in Web Editor NEW
66.0 4.0 18.0 490 KB

Cross-platform native method to receive the list of the launched processes

License: MIT License

Python 3.26% JavaScript 8.07% C++ 85.28% C 1.06% Makefile 1.13% Batchfile 0.72% Dockerfile 0.48%
node js cpp process task-list c-plus-plus cross-platform-native process-monitor process-tree process-list

node-process-list's Introduction

logo

Cross-platform native method to receive the list of the launched processes

Build Status Build status npm license downloads Greenkeeper badge

Install

npm i process-list
# or
yarn add process-list

It's that easy! npm will download one of the prebuilt binaries for your OS. If you need to build process-list, see node-gyp for more details.

Supported OS

  • Windows Windows 7+, Windows Server 2008 R2+
  • Linux any Linux-based distributives
  • OS X Soon...

Usage

const { snapshot } = require("process-list");

const tasks = await snapshot('pid', 'name');
console.log(tasks);

// output
// [{
//    name: "1.exe",
//    pid: 1234,
// }, ... ]

API

snapshot(...field: String): Promise<[]Object>

Returns the list of the launched processes.

allowedFields: []String

List of allowed fields.

  • pid: Number - process pid
  • ppid: Number - parent process pid
  • name: String - process name (title)
  • path: String - full path to the process binary file
  • threads: Number - threads per process
  • owner: String - the owner of the process
  • priority: Number - an os-specific process priority
  • cmdline: String - full command line of the process
  • starttime: Date - the process start date / time
  • vmem: String - virtual memory size in bytes used by process
  • pmem: String - physical memory size in bytes used by process
  • cpu: Number - cpu usage by process in percent
  • utime: String - amount of time in ms that this process has been scheduled in user mode
  • stime: String - amount of time that in ms this process has been scheduled in kernel mode

License

MIT, Copyright © 2014 - 2019 Dmitry Tsvettsikh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.