{"name":"process-top","version":"1.7.1","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"process-top@1.7.1","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/process-top","bugs":{"url":"https://github.com/mafintosh/process-top/issues"},"bin":{"process-top":"bin.js"},"dist":{"shasum":"8ccc4b8e5503227b94ffa9662f7dc59c58b739f0","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.7.1.tgz","fileCount":7,"integrity":"sha512-0JcbbiMKFcROTa3Z+42Z5w+N2YBA+rXILiouTheYYzQgaImAAKkbMDL/CNxGMeNisT/xmWeh9r/dhFFwUeAE4Q==","signatures":[{"sig":"MEUCIQDJZ9p22RuF08T/gCJ7lc9vBFjsR0whXNlBoEd7Ym2hiAIgFJ/N7PQ9cHvTFaU/hctE6bX2RVlhrCRpiQMC3651UW8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8278,"size":3431,"noattachment":false,"key":"/process-top/-/process-top-1.7.1.tgz"},"main":"index.js","gitHead":"58666f311b420ef0c4bde1985eacabe75a56d62b","imports":{"os":{"bare":"bare-os","default":"os"},"./hrtime":{"bare":"bare-hrtime","default":"./hrtime.js"}},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/process-top.git","type":"git"},"_npmVersion":"11.6.2","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"bare-os":"^3.1.0","bare-hrtime":"^2.0.10","prettier-bytes":"^1.0.4","event-loop-delay":"^1.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/process-top_1.7.1_1771537230233_0.4674122821131361","host":"s3://npm-registry-packages-npm-production"},"readme":"# process-top\n\nA \"top\" like module for your Node.js process. Collects CPU usage etc.\n\n```\nnpm install process-top\n```\n\n## Usage\n\n``` js\nconst top = require('process-top')()\n\nsetInterval(function () {\n  // Prints out a string containing stats about your Node.js process.\n  console.log(top.toString())\n}, 1000)\n```\n\nRunning the above will print something similar to:\n\n```\ncpu: 0.4% | rss: 32 MB (0.2%) | heap: 5.1 MB / 8.1 MB (63.5%) | ext: 8.8 KB | delay: 0 ms | 00:00:52 | loadavg: 0.52, 0.37, 0.31\n```\n\n* `cpu` is cpu usage by the process in the last ~5s.\n* `rss` is how much `rss` memory Node has allocated out of your total memory.\n* `heap` is how much heap you are using vs total heap.\n* `ext` is how much external memory Node.js is using (ie, Buffers etc).\n* `delay` is event loop delay the last ~5s.\n* `00:00:00` is the runtime of the process\n* `loadavg` is the current loadavg of the machine.\n\n## API\n\n#### `top = processTop()`\n\nCreate a new process top object.\n\n#### `top.cpu()`\n\nReturns a CPU stats object.\n\n#### `top.memory()`\n\nReturns a memory stats object.\n\n#### `top.delay()`\n\nReturns the event loop delay.\n\n#### `top.runtime()`\n\nReturns the runtime in ms.\n\n#### `top.loadavg()`\n\nReturns the load average of the machine.\n\n#### `top.toString()`\n\nReturns a human friendly string representation of the top object.\n\n#### `top.destroy()`\n\nDestroy the top object.\n\n#### `top.toJSON()`\n\nReturn the stats as JSON.\n\n## CLI\n\nThere is also a CLI tool available.\n\n```\nnpm install -g process-top\nprocess-top my-cool-program.js\n```\n\nThe CLI will print a `top.toString()` line every 1s the program is running.\n\n## License\n\nMIT\n","publish_time":1771537230389,"_cnpm_publish_time":1771537230389,"dist-tags":{"latest":"1.8.0"}}