{"name":"process-top","version":"1.5.2","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"process-top@1.5.2","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":"bb453652e1903033a7d730dd76ab5d568b9acafa","tarball":"http://registry-npm.ywwl.com/process-top/download/process-top-1.5.2.tgz","fileCount":7,"integrity":"sha512-I1EcXWze5ujvpC+E0RB1jkGsmsu7Y0k6Wg6DQFFqwayTW3I7iCbHvaiQgPMe14aJGZ4mp7UJjTpekiwQKfMarw==","signatures":[{"sig":"MEYCIQDHBl46B8z+2NaFLX6RvEuvIcRONhISPn6kOgmbsx9acAIhAP9NEMEB9qJHNLk9JJxWQpNfwXlY1BAK6t2meGEohWvg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8159,"size":3408,"noattachment":false,"key":"/process-top/-/process-top-1.5.2.tgz"},"main":"index.js","gitHead":"4c64ce1f805719a693e13de8c0943af330ec6584","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":"10.9.0","description":"A \"top\" like module for your Node.js process. Collects CPU usage etc.","directories":{},"_nodeVersion":"22.12.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.5.2_1743167458748_0.41090743379038597","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":1743167458919,"_cnpm_publish_time":1743167458919,"dist-tags":{"latest":"1.8.0"}}