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

proc-pid

v1.0.2

Published

Read select "files" from /proc/:pid/*

Downloads

11

Readme

proc-pid

Read select "files" from /proc/:pid/

install

npm install proc-pid

example

var procpid = require('proc-pid')();

procpid.pid(process.pid, function (err, data) {
	console.log(data);
});

api

Constructor

var procpid = require('proc-pid')({ stats : ['io', 'status'] });

.pid(pid, cb);

  • pid is the process id of the process to look up in /proc
  • cb is the callback
    • signature function (err, data)

The data object will contain an attribute for each of the stats requested in the constructor (which by default is io and status).

For example:

{ io: 
   { rchar: '61960',
     wchar: '79',
     syscr: '44',
     syscw: '7',
     read_bytes: '0',
     write_bytes: '4096',
     cancelled_write_bytes: '0' },
  status: 
   { Name: 'node',
     State: 'R (running)',
     Tgid: '28806',
     Ngid: '0',
     Pid: '28806',
     PPid: '25596',
     TracerPid: '0',
     Uid: '1000\t1000\t1000\t1000',
     Gid: '1000\t1000\t1000\t1000',
     FDSize: '256',
     Groups: '7 20 103 111 122 129 1000 1001 5000',
     VmPeak: '719284 kB',
     VmSize: '691732 kB',
     VmLck: '0 kB',
     VmPin: '0 kB',
     VmHWM: '11124 kB',
     VmRSS: '11124 kB',
     VmData: '664476 kB',
     VmStk: '140 kB',
     VmExe: '8496 kB',
     VmLib: '4176 kB',
     VmPTE: '164 kB',
     VmSwap: '0 kB',
     Threads: '6',
     SigQ: '0/46993',
     SigPnd: '0000000000000000',
     ShdPnd: '0000000000000000',
     SigBlk: '0000000000000000',
     SigIgn: '0000000000001000',
     SigCgt: '0000000180004202',
     CapInh: '0000000000000000',
     CapPrm: '0000000000000000',
     CapEff: '0000000000000000',
     CapBnd: '0000001fffffffff',
     Seccomp: '0',
     Cpus_allowed: '0f',
     Cpus_allowed_list: '0-3',
     Mems_allowed: '00000000,00000001',
     Mems_allowed_list: '0',
     voluntary_ctxt_switches: '7',
     nonvoluntary_ctxt_switches: '24' } }

license

MIT